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

3
votes
1answer
16 views

Accidently running perl-script with sh, how to detect that and take actions?

I had a bash-backup-script for quite some time which worked ok for me, but now I needed some features and put them into a perl-script. It works perfectly fine, and I'm happy. But my muscle-memory ...
1
vote
1answer
19 views

Is there a way to run a perl script on a windows system without having to install anything?

I have a handy perl script that I use on my linux systems to check some database information in mysql. I'd like to have a portable version of this available for Windows (specifically Windows 2008 and ...
16
votes
3answers
2k views

Command vs program?

I was looking up the difference between adduser and useradd, and an explanation is that useradd is a command while adduser is a perl script. I understand what a perl script is, but what I do not ...
1
vote
1answer
35 views

Multiple input files and output files in awk

I have a folder full of text files named 000.txt to 181.txt. How can I process all of them (on the command line) with the same awk script (program.awk) and send them to their respective output files ...
1
vote
1answer
34 views

Accidentally deleted the /System/Library/Perl folder

I accidentally deleted all the Perl related folders on my Mac (Yosemite) the one in /System/Library/Perl is the most prominent one. The curl -L http://xrl.us/installperlosx | bash command installs the ...
0
votes
1answer
208 views

Package: otrs-4.0.7-01.noarch Requires: perl(Template) while installing OTRS in centos 6

While I was trying to install OTRS 4.0.7 in centos 6, an error occurred. I tried to Google it, but I cant get the results to resolve the issue. Loaded plugins: product-id, refresh-packagekit, ...
1
vote
1answer
18 views

SED/AWK/PERL(GNU userland) - how to substitute pattern A but not pattern B?

First, I am using GNU userland so you can assume I use Bash, GNU coreutils... I have a HTML and I want to change all href="foobarz" into href="" However, I don't want to change any line ...
0
votes
1answer
21 views

Perl Archive::Zip weird response

This has really baffled me: This code works fine ... $filename="name_of_file.pdf"; for ($x=0; $x<@pdf; $x++){ $file.=$pdf[$x]; } $file=~s/\*ref\*/$new_aff/g; # converts a variable within the ...
0
votes
1answer
116 views

How to point MacVim to the right perl on OSX 10.10?

When I try to use MacVim from the command line, I get dyld: Library not loaded: /System/Library/Perl/5.12/darwin-thread-multi-2level/CORE/libperl.dylib Referenced from: ...
1
vote
1answer
19 views

How to match parameter and replace the value after “=” separator

the perl one liner command to replace Value in file is simple: perl -i 's/oldval/newval/g' file.txt but what should be the perl one liner syntax in case we want to replace the value on specific ...
0
votes
1answer
68 views

I added a simple socket perl server script under Cygwin Xinetd to echo client input but it reads blank instead

I installed a x32 version 1.7.33 of Cygwin on my x64 Windows7 machine. I added a new service under /etc/xinetd.d/ccapi. $ cat ccapi-stream service ccapi { id = ccapi-stream disable = ...
0
votes
1answer
76 views

search and replace string using batch or perl script

How can i search for "//packages/thirdparty/release/main.txt #10" and replace #10 with #15(set VARIABLE="#15") using batch commands and also ignoring spaces. #10 can be anything, lets assume #XXX. ...
1
vote
1answer
21 views

Using Perl regex over multiple lines

I'd like to replace all occurrences of this in a file: ab ba With this: a a I tried the obvious: $ perl -i -p -e 's/ab\nba/a a/' file.txt With no success. How is this done? I can't find any ...
1
vote
1answer
69 views

how to view all process details from ps –ef command

I am using the ack.pl in my bash script to search IP's in the Linux OS only for example , and only to show the problem I will give here a short example # ( ./ack.pl -Q -a -l --max-count=1 ...
1
vote
1answer
57 views

Decode QR from image (or how to run Exec in a loop)

I need to decode a folder full of QR code from image files. After A LOT of research, I finally found a libary that works on Windows. Not my ideal choice (Zbar won't install on Strawberry PERL as ...
-2
votes
2answers
49 views

Copy sequential files into sequential directories

I need to copy multiple, sequential files into sequential directories. The files have the julian date (day of year) with other info in the file name. The directories are listed by julian date (day of ...
0
votes
0answers
70 views

ArchLinux can't install perl-wx

I am trying to install perl-wx from the AUR Repo with yaourt, but can't get it to work. I have tried "export LC_ALL=C". Still an error occurred during the check. Maybe you can help me? Pastebin: ...
0
votes
1answer
37 views

Executing Perl command from shell script not resulting into anything

I am trying to execute the below command from a shell script: perl -pi -e 's/Ç/|/g' diff_new_old.dat This command gets executed without any errors, but the execution doesn't do the intended ...
1
vote
2answers
320 views

Making a juniper VPN work on linux

I've tried several tools, the original scripts (ncsvc and ncui) do not output any error message to know what wrong with connection, even with wireshark I could not know what was wrong. The best tool I ...
1
vote
1answer
93 views

OSX 10.10 select perl 5.16 instead of 5.18

I find that my OSX 10.10 comes with perl 5.16 and 5.18. By default, when I run perl, I am using perl 5.18. Is there way for me to run perl 5.16 when I run perl command? admins-Mac-mini:~ ...
0
votes
2answers
236 views

How to call perl file every minute from batch file

I have written a perl script which i try to call every 1 minute from a batch file. There is no error but it do not call it every 1 minute. It just pop command prompt when clicked once on .bat file. ...
0
votes
1answer
112 views

How to delete a particular line in a text file after some operation on that text file at the same time

I am perl bginner (but i guess logic is same for all programming languages like C++ and C in my case its perl). What i want to achieve ? I have a text file i read that file which contains different ...
1
vote
1answer
52 views

How to get the count of a string from a text file . The output is wrong

I have written a code for finding the IP address count from a text file. if similar IP dress exist in file toto.txt : My code to do this is: use strict; use warnings; my %count; my $str ; #my $file ...
0
votes
1answer
118 views

How to stop a running .bat file which runs after every 10 minutes

I have written a .bat file which runs every 10 minute. The problem is now when i want to stop it it never stops. (This .bat file further calls a perl file in the code). What can be done to kill it ? ...
0
votes
1answer
239 views

mod_perl not active on Apache/2.2.15 (Red Hat)

I am using OTRS on a RedHat 6.5 with apache2 and mod_perl2. One of my servers (Sandbox environment) has the following (yum info feedback): Installed Packages Name : httpd Arch : x86_64 ...
0
votes
0answers
40 views

when istall latexml from cpan or cpanm, it just cannot find the package

cpanm output cpanm latexml ! Finding latexml on cpanmetadb failed. ! Finding latexml () on mirror http://www.cpan.org failed. ! Couldn't find module or a distribution latexml cpanm LaTeXML ! Finding ...
2
votes
1answer
158 views

When trying to start Apache - Cant load “Magick.dll” for module Image::Magick?

I have ActiveState Perl 5.10 installed on Windows 2008 machine. I installed ImageMagick-6.8.7-9 Q16 (32-bit) installed. Instead of using ppm to install PerlMagick I built it myself using dmake and gcc ...
0
votes
2answers
87 views

Text deletion between patterns across multiple lines with respect to text inside pattern

I have a block of text I need to delete, however, only if it contains specific text inside the block: ... <script language="JavaScript"> var somethingA = 0; var somethingB = 0; var ...
1
vote
2answers
54 views

Replacing several strings in a file in one go

Suppose I want to replace all AAA with BBB and all BBB with AAA in a text file. The thing which looks an obvious solution (in Perl or in Sed) is: s/AAA/BBB/g; s/BBB/AAA/g; But this does not ...
0
votes
1answer
52 views

What are MINIMAL necessary reqirements to run Perl CGI scripts on Apache server?

I have my Apache showing perl scripts as plaint text, not executing them. Googling and playing with settings made me frustrating, because there are numerous and long samples, which are mostly ignored ...
0
votes
1answer
177 views

FreeBSD make error - File 5.19 supports only version 12 magic files. /usr/share/misc/magic.mgc is version 8?

I'm having trouble reinstalling ProFTPD on a FreeBSD 10.1 setup. The server is newly upgraded from 10.0 to 10.1. When I start the make install clean process, these warnings first shows on screen. ...
0
votes
1answer
40 views

How can I run this Perl script in Windows?

I am trying to run a PERL script for the first time. Here it is : http://search.cpan.org/dist/HTML-ExtractMain/lib/HTML/ExtractMain.pm I have never used or worked with PERL before and I am finding ...
1
vote
1answer
201 views

Amavis - How to blacklist using regex, from an external file

I currently have this line in my amavis user config file: # BLACKLIST read_hash(\%blacklist_sender, '/etc/amavis/blacklist'); It works fine with entries such as: .baddomain.net .spam-galore.net ...
1
vote
2answers
43 views

Make perl regex search exit with failure if not found

With grep I get a failure return code/exit status if no result is found. How can I do the same thing with perl? Basically, I would like to change the following so that it exits with status 1 if no ...
0
votes
1answer
15 views

Where can I see the log statements of a task in Windows 8?

I created a task in task scheduler which essentially runs a perl script. I have some print/log statements in the script. Where can I see these log statements?
0
votes
1answer
21 views

i need to pass a string of an output file to a variable so as i can use it globally all over my script [closed]

sample output RETENTION_INTERVAL ------------------ 10080 I need to pass the numeric value "10080" from the output file to a variable .The condition should validate value and ...
0
votes
0answers
51 views

Monitoring a log file and send a notification (mail) when string is triggered

I want a nofitication (email) when the user-foobar is triggerd in the apache log like this 10.10.55.171 - userfoobar [21/Nov/2014:12:06:01 +0100] "GET /download/2719/test.jpg HTTP/1.1" 200 ...
0
votes
0answers
22 views

Using exif and regex in perl to determine if video has an audio track

I am currently using exif to get info about a video file in PERL. I am running this command to do so: $cmd1 = "/usr/local/bin/Image-ExifTool-9.08/exiftool $therow->{'FileName'}.mp4"; $output = ...
0
votes
0answers
189 views

PowerShell issues with spaces in directory names

PowerShell has issues with spaces in directory names. I am trying to execute a file in the same directory as the PS1 script like so: .\getGravatarsForGource.pl It works fine when the directory ...
-1
votes
2answers
51 views

How can I set a count down timer in perl for doing a function repeatedly?

I am copying a file from one file to another. I want to check whether the source file is available or not repeatedly in every 10 secs. How can I check it in between copying?
0
votes
1answer
33 views

How to wait for 3 mints if the n/w got disconnected while copying in Rsync without failing using perl script?

I have to transfer 2-3 GB using Rsync.Everything is working fine, but my network got disconnected sometimes, and the entire process got failed. I want to retry it for the network for every 3 mints, ...
0
votes
0answers
25 views

safe-mode and its effects on vhosts - why does turning off help

on a root server - with several domains with different vhost (configurations) i run several wordpress on domains - and wthin the wordpress i have a plugin that allows uploads of images -within a ...
1
vote
1answer
189 views

How do I use MacPorts' Perl installation with MAMP?

I have MAMP 3.0.6 and MacPorts 2.3.1. There are some Perl modules that I need to use (through some CGI scripts), I installed them on the MacPorts Perl installation (e.g., p5.16-dbd-mysql), but I can't ...
4
votes
1answer
720 views

Error while installing Perl package Term::ReadKey in Cygwin

I'm trying to use git via cygwin Well, I used this command to clone the svn content to a local git repository: git svn clone svn://path/to/my/project --username myuser Git was returning: ...
1
vote
1answer
323 views

Missing Switch module on exiting Perl installation

I have been working on a Linux 64bit cluster for months, and this morning it seems as if the Switch module for Perl has disappeared from the system. If I do a find on the place where I expect it to ...
-1
votes
2answers
45 views

how to split a hex file into two hex files at the first match of certain criteria in perl or just unix scripts

I have a HEX file containing following, I want to split them into two HEX files based on the address: file_in.hex @00000000 00 FC 00 20 89 01 00 00 D9 01 00 00 DB 01 00 00 DD 01 00 00 DF 01 00 00 E1 ...
0
votes
1answer
145 views

Wrong apache configuration. Perl scripts cannot execute

I've got wrong apache configuration. My script don't want to be executed and browser trying to download it as a file. <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName president.com ...
0
votes
2answers
1k views

How to execute a PL file in Linux?

I have a vmware-install.pl file that I need to execute. I double click it but Linux will open it in a text editor for editing. How to execute this file? Can it be done from GUI? In file's properties ...
3
votes
2answers
226 views

Autoformat for Perl in Vim

I got a piece of code about perl: if ($a==1){ &err_report("$a"); while($b!=1){ &err_ok(); } } And, I want to format it in vim. After using command: gg=G, the code ...
0
votes
0answers
29 views

Perl module DBI and DBD::ASAny install failed in windows

While install perl module DBD::ASAny the following error is occurred. How to fix this issue? C:\Users\rajan>cpanm DBI DBI is up to date. (1.631) C:\Users\rajan>cpanm DBD::ASAny --> Working on ...