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.

learn more… | top users | synonyms

1
vote
1answer
103 views

send sms with perl and google voice

I try to send sms to my mobile phone with perl and google voice. I have installed google::voice module with perl : perl -MCPAN -e "install Google::Voice" perl script: use Google::Voice; my $g = ...
0
votes
1answer
154 views

Saltstack regular expression to target all except

I'm having trouble using regex with salt to target every minion except one. I have tried every example I can find and exhausted my limited understanding of Perl regex. I expect this to target every ...
-1
votes
2answers
51 views

Converting Perl Regex to PHP [closed]

I have the following Regex in PERL which I need to convert to PHP if($line =~ m/[<]div class="row.* id="(vm_[0-9]{8,9})"[>]/i){ } I currently have the following in PHP to match it, but I'm ...
0
votes
0answers
120 views

USB Stick Becoming Write Only

I am running windows 7. I have a 2GB flash-drive running a strawberry Perl portable edition. I was spending time installing CPAN modules this morning when suddenly my disk became write protected. ...
-7
votes
1answer
63 views

Regular expression for matching multiple HTML lines [closed]

<tr id="1078197327`honda`civic-sdn" title="2013 Honda Civic Sdn" class="listingRow"> I tried the following code: foreach $line (@lines){ if($line =~ m/[<]tr ...
1
vote
1answer
268 views

How to get sha1sum to work on Mac OS X?

I have an application that I'm porting and as part of the test suite, I run sha1sum. I'd like to have test code that works on all my platforms and not vary across platforms. Mac OS X, is the first ...
0
votes
1answer
40 views

What regex pattern would I have to use to parse out unwanted characters in this format?

#!/usr/bin/perl POSIX qw(strftime); my $time = strftime("%YT%mT%d TTTT%H:%M", localtime); print ("Todays date and time is $time\n"); I am a little rusty at regex, what would be a pattern to search ...
0
votes
0answers
14 views

Convert data acceleration from HEX to decimal [duplicate]

I have an accelerometer which generated hex file with a time stamp, it has acceleration data from three axes. The data looks like this: 14:50:20.046:01 F7 C1 14:50:20.062:FA 81 C6 I need to convert ...
1
vote
0answers
16 views

Using Perl to communicate with Nut

I'm trying to communicate with my UPS that's managed using NUT. I want to read values from it like line voltage, battery charge, etc. I don't want to send it commands to shut it down. At first I was ...
0
votes
0answers
39 views

open a new screen in linux, no access to perl local library

I added my perl local library to my shell startup script (.bashrc) and when I start a terminal in linux: $ echo $PERL5LIB /home/perl5/lib/perl5:/usr/share/vcftools/perl BUT when I open a new ...
1
vote
1answer
48 views

error in /usr/share/perl5/iCal/Parser/HTML.pm on debian

how to fix this? when i type perl /usr/share/perl5/iCal/Parser/HTML.pm i get syntax error at /usr/share/perl5/iCal/Parser/HTML.pm line 64, near "$t qw(week month year)" Global symbol "$t" ...
0
votes
1answer
208 views

Problems installing .ppd files (PERL) from CronW v2.0

I wanna test CronW to have some (acceptable) task scheduler under Windows XP, but after installing the v2.0 .exe and the .msi of ActivePerl v5.16.3 (both 32 bits), the next step of installation ...
0
votes
1answer
59 views

Perl remove characters in a string

I have a $cbDescription variable in a Perl script. When I print out $cbDescription, I get the following: tIP SOLD -5 /ESH4 @1832.00 I want to remove any + or - or @ signs or commas from the ...
3
votes
2answers
565 views

How to comment out multiple line matching a regex using sed or awk

I have a file that contains this: [...] location /static { ... multiple lines ... } [...] location /static/ { ... multiple lines ... } [...] And I want to get: [...] # ...
0
votes
0answers
58 views

How to change definition of HERE DELIM in notepad++?

I am planning to document shell scripts with embedded Perl pod as explained here: http://bahut.alma.ch/2007/08/embedding-documentation-in-shell-script_16.html The problem is Notepad++ has a narrow ...
0
votes
0answers
19 views

Can One Extract a Hyphenated Filename File From a Server Using Curl?

The images I'm dealing with have file names like part-1.jpg, object-a.jpg, Aspect-0.jpg. What I'm wondering is what I put in place of ???: curl -O http://server/[???].jpg
7
votes
2answers
763 views

Macport upgrade fails with subversion-perlbindings conflict

I'm trying to do a port upgrade outdated, but it stops on a package conflict that I'm not able to fix. Does anyone know how to fix this problem? sudo port upgrade outdated ---> Computing ...
0
votes
0answers
319 views

Template toolkit aware editor for Jetbrains IDEA

I work with Template toolkit files in a large perl project but in my favorite IDE, Webstorm/IDEA I can't find support for TT files. ATM I use the HTML editor do work with TT files but its not ideal. ...
0
votes
1answer
86 views

Perl read file returning only partial lines

I am trying to write a script to rename files based on a given list. To test to make sure the list is read correct, I have: print("start\n"); open(READFILE, "<prune.txt") || die "Couldn't open ...
1
vote
2answers
147 views

Perl comments on a Mac

I am trying to run a Perl script I wrote from the command line. The code is: #!/usr/bin/perl #open file open(READFILE,"<prune.txt") || die "Couldn't open file"; #read line while (<READFILE>) ...
1
vote
1answer
230 views

Installing libpng on a Mac with Maverick

I want to install libpng library on my Mac, which runs under Mavericks. Here is a simple Perl script to check if it is ok: use GD; my $gd = GD::Image->new(); my $ok = $gd->can('png') ? 'Yes' : ...
1
vote
1answer
104 views

Which tool is most flexible for searching my whole system, locate or mdfind?

Follow-on to Spotlight and the locate command don't search *all* folders: The steps mentioned by Gordon Davisson were performed; .bashrc was entered in the Spotlight search field, and System and ...
2
votes
0answers
2k views

Xcode: create new custom templates and code snippets?

I'm trying to tame Xcode for writing things in Perl. Naturally, I'd like to use the "IDE features", not just the text editor. That includes Perl-specific templates, which brings me to the question: ...
0
votes
1answer
147 views

Find number in string and replace it

I wrote C++ code and now I want to replace the number in a string by using shell scripts. The part that needs to be replaced: if (random<=90) How I can change the 90 from a shell script? I ...
0
votes
2answers
95 views

sum numbers in different lines in shell

i have 8000 lines similar to this <Flow flowId="1" timeFirstTxPacket="+0.0ns" timeFirstRxPacket="+924100.0ns" timeLastTxPacket="+199984927558.0ns" timeLastRxPacket="+199675473275.0ns" ...
0
votes
1answer
80 views

Rename files from in1.jpg, in2.jpg, in3.jpg, etc to out0001.jpg, out0002.jpg, out0003.jpg etc using perl script `rename`

I would like to rename a large number files with names in1.jpg, in2.jpg, in3.jpg, etc to out0001.jpg, out0002.jpg, out0003.jpg, etc. Grateful if somebody would suggest a solution using the perl script ...
1
vote
1answer
604 views

extract characters between first and second underscores of filenames and count such files in linux folder

I would like to extract characters between first and second underscores of filenames in a folder and count such type of files present in it. The folder contains files in a particular format such as : ...
0
votes
1answer
94 views

Perl script to fetch a particular directory and modify the xml file

I have written a perl script to modify xml file which is working fine for only one file. I want my script to fetch the xml folder and modify the xml file inside it. Like that it should run for all the ...
-1
votes
1answer
370 views

perl scrip to insert multiple line after a specific string

I am trying to insert multiple line between a two specfic line in perl. But my code is having some issue which i am not able to figure it out. open(FILE,"abc7.xml") || die "Can't open file: $!"; ...
0
votes
0answers
31 views

PERL executable size getting reduced automatically after few days

On one of my RHEL 5 machine, there is one PERL executable which runs under cronjob at frequent intervals of time. The strange thing observed is PERL executable size is getting reduced automatically ...
0
votes
1answer
136 views

SortTV perl script error

I'm trying to use a perl script named SortTV (http://sourceforge.net/projects/sorttv/) Every dependencies is installed but I got an error & can't understood it... It's not a specific problem of ...
0
votes
1answer
2k views

Install XML::Parser

I'm trying to install some perl module but got strange error. sudo cpanm XML::Parser cp Parser/Encodings/iso-8859-5.enc blib/lib/XML/Parser/Encodings/iso-8859-5.enc make[1]: Entering directory ...
1
vote
1answer
659 views

Install perl module with dependencies

I'm trying to install a Perl module like this : pi@raspbmc:~$ sudo cpan HTTP::Date Cpan get the file Checksum is ok uncompressed successfully But I got this error : Using Tar:/bin/tar xf ...
0
votes
1answer
95 views

shell or perl script to replace the double quotes with their unicodes

I am having two files names as a.html a.xml in a folder and in a.html file i have a tag <div class="snippet abstract"> We present a new "model" for multiple-input-multiple-output ...
0
votes
2answers
60 views

How can 2 or more instances of the same program to communicate in local network? [closed]

I want to create program which will be in use for few computers connected in local network. Basically the program aim is to keep track of all tables in a bar ( lets say ), which are reserved. When ...
0
votes
1answer
134 views

how to get Geo::Coder::Many with cpan?

Ubuntu is installed for development of a Perl project. aptitude search Geo-Coder i libgeo-coder-googlev3-perl - Perl module providing access to Google Map Aptitude does not refer to ...
0
votes
2answers
39 views

Where to place an executable Perl script?

I'm now planning a solution that has to call a script that's running on a Linux \UNIX host. I'd prefer to place that script in a folder that exists in all kinds of Linux and UNIX. This helps me to ...
2
votes
2answers
8k views

Apache 2.0 - Disabling the HTTP TRACE and TRACK methods

I use Apache 2.0 as HTTP server and specific purpose Perl-based HTTP clients. Until now I disable TRACE and TRACK methods using the following configuration in the httpd.conf file: RewriteEngine ...
1
vote
1answer
1k views

How can I fix broken apt/perl libraries?

I've got a Raspberry Pi set up as a web server, everything all working well until 5 mins ago, and I seem to have messed up man-db, apt or some perl library. apt-get doesn't seem to be updating and ...
2
votes
2answers
3k views

gcc not finding header file though its path has been included with -I

I'm trying to install a module (Package::Stash::XS) via cpanm, but the installation is failing due to a gcc error. The command gcc -c -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -fno-strict-aliasing ...
2
votes
1answer
148 views

Could not perform immediate configuration on 'perl'

I'm trying to upgrade a debian squeeze system to wheezy. I've done an apt-get update && apt-get -V upgrade on squeeze, then changed my source.list to reference wheezy not squeeze. then, ...
1
vote
1answer
301 views

How do i make a perlbrew version my default?

I work on a Mac, and my default perl version is v5.12.4. For 99% of the time I use a perlbrew install I have, as I for my work need numerous modules I don't want to install on system perl. Is there a ...
7
votes
1answer
2k views

Shell script to find all types of files in a directory with their count

I want to write a shell script or alias to find the number of different types of files in a directory. For example, sample output of script should be: *.h 20 *.c 40 *.cpp 10 Makefile 3
2
votes
1answer
111 views

Perl program won't run on arm6, but it runs on my 64bit computer

I'm trying to run [pisg][1] on my raspberry pi, which is running archlinux arm, and every time I try to run it, I get: Root ~>pisg -cf pisg.conf Warning: Couldn't parse -cfg option Could ...
0
votes
2answers
665 views

Attempting to read data from a text file and inputting the variable text to a script

I have a file with 25 single word entries, I need a script to read through the file one line at a time and input the variable phrase into a second script that will generate a individual file based on ...
10
votes
2answers
826 views

How to cut a file to a given size under Linux?

I want to shrink a file's size by brute-force, that is, I don't care about the rest, I just want to cut the file, say by half, and discard the rest. The first thing that comes to mind is Perl's ...
1
vote
0answers
331 views

Solaris: ssh -tt with no output

I have access to a machine running SunOS 5.10 (called solaris). I also have access to a RedHat machine (called redhat). ssh -tt seems not to give me output if run from solaris to solaris, but works ...
2
votes
2answers
2k views

How to install a 32 bit version of perl on 64 bit Cent OS server?

I want to install 32 bit version of perl on my Cent OS server which is of course of 64 bit..Output of perl -v is [root@M-229 ~]# perl --version This is perl, v5.10.1 (*) built for ...
2
votes
1answer
136 views

Clean up filenames using data from a text file

I need to clean up a bunch of folder file names. Possibly even the file titles as well. I was currently using this Perl script to do so but I ran into some problems. If the file name already has ...
2
votes
2answers
2k views

chown function in Perl

I have problems with the working of the chown function in Perl. I have a script: #!/usr/bin/perl $file = ""; $file = $ARGV[0]; $user = "jboss"; $group = "jboss"; if ($file eq "") { ...