Questions tagged [perl]
Perl is a powerful, high level programming language. Questions about Perl should be limited to the Perl development environment, running Perl, or using Perl to automate tasks on your computer.
501
questions
4
votes
2
answers
9k
views
Is there a way to execute a perl script from any location in the machine?
I'd like to know if there are other ways to execute a perl file without giving the path explicitly.
example:
perl ./images/seed/test.pl
I read on the export path command but I don't quite understand. ...
1
vote
1
answer
588
views
How do I upgrade SpamAssassin?
When I try to update SpamAssassin, it says it has the latest version.
# cpanm Mail::SpamAssassin
Mail::SpamAssassin is up to date. (3.004004)
However, the latest version says it is 3.4.4. https://...
1
vote
2
answers
996
views
Regex to substitute character with numbers around it in filenames with rename utility (perl based)
I would like to rename files that have the following format:
somethingblabla15T06:58_31+0000somethingblabla.bla
THe new name should be
somethingblabla15T06:58:31+0000somethingblabla.bla
So the _ ...
2
votes
1
answer
533
views
How to print absolute path of some file from c:\ root in perl?
Having this perl:
#!/usr/bin/perl -w
use Cwd qw[abs_path];
use autodie;
opendir C, "c:\\";
@ar = map { abs_path($_) } readdir(C) or die $!;
print $ar[0];
I am trying to print an absolute ...
2
votes
2
answers
650
views
Combine strings with same first word preserving their order
I have a file that contain many lines consecutive and non consecutive with same first word and i want to merge all those lines.Not finding any way. please suggest someone.
eg.
cat file
X blah blah ...
0
votes
1
answer
943
views
Associate .pl files with Prolog instead of Perl system wide
I'm learning Prolog at University and have a lot of *.pl files. I already managed to make gedit recognize them as Prolog files and not Perl Scripts for syntax highlighting following this question and ...
0
votes
3
answers
1k
views
sed + how to replace numbers with parenthesis with sed/awk/other
we want to relapse the [1023,1024,1022] as described in the following file , with [1022]
more file.exm
{"topic":"nj_hgf_dfgef","partition":0,"replicas":[1023,1024,1022]},
{"topic":"nj_hgf_dfgef","...
0
votes
1
answer
568
views
OpenSSL Timestamp log location
I am trying to debug an openssl ts based perl http server. The server logs display an openssl ts -reply command failing with exit code 1.
Where can I see the logs related to this openssl command, or ...
2
votes
0
answers
220
views
Python and Perl not recognized in cmd even after adding in environment
It was fine yesterday, but it suddenly stopped working today.
Both my perl and python were not recognized in cmd. I read as much as i can online for the answers and follow the instruction. I have ...
4
votes
1
answer
10k
views
Add a new element to existing JSON array
How can I add "arn:aws:iam::xxxxxxx:role/3" line below "arn:aws:iam::xxxxxxx:role/2" adding a comma after "arn:aws:iam::xxxxxxx:role/2",.
Before:
{
"Version": "2012-10-17",
"Statement": [
{
...
1
vote
1
answer
70
views
Can I get this Perl command on Windows to not generate dates with apostrophes in LibreOffice?
Based on the help I got on this question, I have this Perl command that I run in Windows 10 PowerShell:
ls |% { $_.Name } | perl -pe 's/(.)(.*)_(\d{4})(\d{2})(\d{2})_(\d+).jpg/\u$1$2,$3-$4-$5,$6,$&...
0
votes
1
answer
240
views
How to add prefix from row at the beginning few next lines in Notepad++?
I would like to use a line as a prefix for a few more lines. For an example, please consider the situation where I have these lines:
hostname-junek-1
;ge-1/0/1
;ge-1/0/2
;ge-1/0/5
;ge-1/1/27
;ge-1/1/...
0
votes
1
answer
43
views
removing BerkeleyDB rows using Perl
I have no experience with Perl or BerkelyDB. I have a huge BerleleyDB with a list of email and a unix timestamp. I need help to remove email with older timestamp , older than 100 days .
I have this ...
0
votes
1
answer
444
views
perl script cannot find modules because of permission problems
I have a perl script that runs when I run it as superuser and it does not run when I am a normal user. I installed Perl from sources and typed make install as superuser. I guess this created a perl ...
1
vote
1
answer
382
views
replace sub-string with last special character, being (3rd part) of comma separated string
I have a string with comma separated values, like:
742108,SOME-STRING_A_-BLAHBLAH_1-4MP0RTTYE,SOME-STRING_A_-BLAHBLAH_1-4MP0-,,,
As you can see, the 3rd comma separated value has sometimes special ...