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.

Filter by
Sorted by
Tagged with
0
votes
1answer
29 views

500 Internal Server Error when run perl file and no access to command line

I'm a newbie with Perl. I've created a simple file test.pl with the code: #!/usr/bin/perl print 'test'; uploaded it to my shared hosting with Linux where PERL is enabled and changed my PERL file ...
0
votes
1answer
171 views

Why does this regexp — which attempts to match characters between “@” characters — fail?

I need to extract the second field of selected lines in a GEDCOM file. These lines are all of the following format: % grep @ /tmp/XYZ | tail -5 0 @X701@ OBJE 0 @X702@ OBJE 0 @X750@ OBJE 0 @X765@ OBJE ...
-1
votes
1answer
82 views

Need to autoincrement directory names but by avoiding some letters in the name

My script creates a set of directories aa, ab, ac, and so on This script autoincrement directory names but I want to avoid the letters: I, O, P, Q, R, W while creating directories. The script which I ...
0
votes
0answers
19 views

Losing my mind trying to get a CGI script to execute instead of download using Nginix and Ubuntu 20.04

I cannot get a CGI script to execute itself instead of opening up a download window, do I need to add something indicating it should be inline? I've been trying for about two days and I'm stuck so ...
0
votes
0answers
28 views

How to add data attributes to index html when serving via nginx and using perl script

Isssue: Using the ngx_http_perl_module how do we modify the index.html such that to add data attributes (query param and post param) in the index html body before serving back to client. ? Is it even ...
0
votes
1answer
32 views

Unable to install DBD::mysql on Ubuntu 20.04

I am unable to get DBD::mysql installed on Ubuntu 20.04. I get the following error: Warning: No success on command[/usr/bin/perl Makefile.PL LIB=/home/htm/Lib] DVEEDEN/DBD-mysql-4.050.tar.gz /usr/bin/...
0
votes
0answers
20 views

Sending args from bash to perl

I eally need help I would like to send args from bash file to perl file. I dont know why it is not working for me. My code foe testing is bellow *******bash code ********* #!/usr/bin/env bash chmod +...
0
votes
1answer
26 views

a very simple Perl script needed

I have the following text file G.txt. I need a perl command perl -e ... that would extract all negative entries ending with Kč, so that first line it will be -107,60 and last will be -63,00 I have ...
0
votes
1answer
23 views

Combining two txt files containing name and last name on command line

I have two text files. First file have 20 Names listed in seperate lines and 2nd file have 20 surnames listed in seperated lines. How I can combine those files. So final text file have both first name ...
1
vote
1answer
69 views

How to make fork() fail?

For a script I'm writing, it's important to properly handle a failed fork() (see https://rachelbythebay.com/w/2014/08/19/fork/ for the Why). But how, without bringing my system down with processes, ...
0
votes
0answers
11 views

Perl module, which is it? .pm file, or system installed module?

I am confused about exactly what a Perl module is. Example, I have been trying to install Geo::IPfree locally (don't have root privileges on the server.) I am told to download the tar.gz file, NOT ...
0
votes
0answers
25 views

Reading email headers in Perl

I have an email account (user@domain.com) and an alias (alias@domain.com) pointing to the account. An email sent to alias@domain.com is delivered to user@domain.com as expected. Email headers in MS ...
0
votes
0answers
27 views

How to write dynamic DSL queries based on dynamic set of inputs?

I have created a user interface to provide search feature on data indexed in Elastic search. The user interface provides a list of attributes that must be filled in by the user and based on user ...
0
votes
0answers
17 views

I failed to install the perl module Alien::Gimp

Hello good people of the internet, I fail to install the Alien::Gimp module. I'm new very to Perl and don't understand the error messages I'm getting. This is what my build.log file shows. ==> ...
0
votes
1answer
28 views

Perl/Bash Solution to Test if a Folder Has Changed, Then Create Copy of It

I'd like to put together a script for a very rudimentary backup system that checks a directory recursively for any changes since the date another directory (the backup) was created and, if it finds ...
0
votes
0answers
21 views

Can't download the Gimp module from cpanm because Pango-1.227 and Alien::Gimp Fail

I'm attempting to write some simple Perl with Gimp script. Following a tutorial that tells me to download the Gimp module. I'm very new to this but when I run the command sudo cpanm Gimp I get a ...
2
votes
0answers
12 views

How to rename a perlbrew installed version

I installed Perl 5.32 with the name perl-5.32.0 $ perlbrew list * perl-5.32.0 The installation was updated with perlbrew upgrade-perl and I now have 5.32.1 $ perl --version This is perl 5, version ...
2
votes
1answer
70 views

Shell special chars blowing up regexp(s) in all: sed, (g)awk, and perl [closed]

I would like to change the PS1 in my ~/.bashrc programmatically with any of the the most popular regexp tools { sed, awk or perl }. However, I have problems with special characters. Note that in the ...
0
votes
1answer
32 views

Transpose vertically with a catch

I've been working through some issues preparing data for logstash ingestion. I have a decent chunk of the process worked out but I'm wondering if there's a better way to do this. Basically I need to ...
0
votes
0answers
45 views

Chmod -R 700 / (systemwide Chmod) Wireless not detected. Is there a way I can fix this with Perl?

Multiple issues here. I tried to chmod my home directory as root to 600 and it hit the entire system before I could stop it. I don't know what the settings are supposed to be but I know Perl can fix ...
2
votes
2answers
664 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. ...
0
votes
0answers
47 views

UTF-8 to UTF-16 in perl

I want to convert an UTF-8 string to an UTF-16BE string in the hex notation. As an example, the string "C'est-à-dire que ça c'est l'été." should be converted to ...
1
vote
1answer
38 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
2answers
110 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
1answer
85 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
2answers
29 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
1answer
93 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
3answers
259 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
1answer
44 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
0answers
63 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
1answer
2k 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
1answer
42 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
1answer
38 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
1answer
22 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
1answer
29 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
1answer
148 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 ...
0
votes
1answer
110 views

awk + print lines only if second field match hours:min:sec

log file is like this 34.3.23.58 07:20:01 AM all 0.02 0.00 0.02 0.00 0.00 99.97 34.3.23.58 07:30:01 AM all 0.02 ...
0
votes
0answers
338 views

perl: warning: Setting locale failed. Centos 6.9

I am receiving the following error message on my Centos linux server for past 15 days. perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "...
1
vote
2answers
36 views

How to globally replace programming code using literal input files?

I will use HTML as an example. But it could be any programming code for any language. This comes up often enough, it would be useful to deal with the literal text code to search and replace. This is ...
1
vote
0answers
1k views

Perl install module fail on WIN10

I was trying to install Spreadsheet::WriteExcel module via CPAN tool for Aactive Perl(5.28.1 version). However , when I executed command "cpan install Spreadsheet::WriteExcel" , it showed some error ...
1
vote
4answers
219 views

What are the ways to replace a fixed string (not regex) as a whole word in command line on Linux?

What are the ways to replace a fixed string (not regex) as a whole word in command line on Linux? For example I would like to replace literal "b.*c" as a whole word, with literal "\t", without ...
0
votes
1answer
64 views

Unable to access config'd custom xmp namespace in exiftool

Though some form of me just not really getting it, I am unable to write this custom XMP namespace I've made in my config file. Below is the file. %Image::Exiftool::UserDefined = ( 'Image::ExifTool::...
-1
votes
1answer
109 views

How to create %hash which will be contains key => name of file, value => file contents?

For exemple, I have 1 file 8854 File contest is: ABCSDESG
1
vote
0answers
86 views

XML::Parser Perl module is not installed

Installation was successful and went well in my droplet (using DigitalOcean) but when I view the page that requires XML::Parser I still got this error message: Internal Server Error XML::Parser Perl ...
1
vote
1answer
359 views

How to set environment variables for DOSBox with telnetbbs

I'm looking for the exact way to implement the SDL environment variable from a perl script that is the front end for launching a dosbox BBS. I have the right approach from this link: running-dosbox-...
1
vote
1answer
122 views

Is there a download option for the documentation and tutorials at https://perldoc.perl.org/5.30.0? (Windows user)

I want the documentation and probably the tutorials saved locally on my computer, as usually I only have a 64 kbit/s internet connection. I'm working on Windows 10. At perlfaq1.html#AUTHOR-AND-...
1
vote
1answer
134 views

How can I use :perldo in vim on Windows?

I installed Git Bash and vim was pre-installed. I personally would rather use PCREs instead of vim's regular expressions, so I tried doing :perldo /s/foo/bar. The error was that it could not find msys-...
0
votes
1answer
111 views

Named capture groups from command line

I've come up with the following regular expression: \[release(\s+(?<release_type>.*))?\]\n+(?<release_notes>.*) The idea is to parse a commit message for several params: [release minor] ...
0
votes
2answers
130 views

Perl script doesn't execute properly in crontab or shell script

I have a Perl script (that came with my Vicidial dialer software) that runs perfectly in the Linux command line. It sends an email at the end of the script. The script doesn't create any errors and ...
0
votes
1answer
132 views

cron returning json.pm error Cent OS 7

I am running Cent OS 7 and trying to invoke a perl script to update Over the Air TV Guide data to XML for my Plex media server. The problem is that Cron doesn't run the script. If I run the script ...

1
2 3 4 5
10