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

-2
votes
0answers
12 views

find dimension (width and height) of multiple images and set that dimension in image tag in html/xhtml pages according their image name [closed]

perl code to find dimension (width and height) of multiple images that located in image folder and set that dimension in image tag in html pages according their image name. i am try using this code ...
1
vote
2answers
66 views

OEL7 - How do I get perl-Template-Toolkit and perl-XML-LibXSLT without CPAN?

I want to open this thread by saying that I'm no Linux expert whatsoever. I'm currently attempting to install otrs-5.0.10-01.noarch.rpm (otrs.com) on OEL7_x86_64 which seems to be built upon Red Hat 7 ...
-1
votes
0answers
8 views

how send email with attachements in perl [migrated]

I am trying out following code for send email with attachemnts. however this code sends only email not attachements. can someone please help ? open(SENDMAIL, "|/usr/lib/sendmail -oi -t -i") or die ...
-1
votes
0answers
17 views

What is a simple regular expression to obtain a number [migrated]

I have a $variable= 9.1R999 I need a regular expression to obtain a digit before and after '.' Means i need 9.1 stored in a new variable $variable1 can someone help here please?
0
votes
1answer
39 views

How to transparently substitute sha1sum for shasum in sh shell?

I have a test that needs to run on multiple platforms. On all other platforms, the test uses sha1sum, but on my Mac OSX El Capitan, there is no such program installed, but shasum works fine as a ...
0
votes
1answer
28 views

Bash script to find content of file in a directory and add value

I have a directory with a huge number of files. I want to write a bash script to - Enter that directory Find out which of them are Perl scripts (but none of them have a .pl extension) Add a line at ...
0
votes
0answers
21 views

About grep, what's the main difference between using option E(ERE) and P(Perl)

About Grep tool in RHEL, usually I use -E option which is ERE grammar, but sometimes I use -P to use the look-ahead/behind-positive/negative grammar. I know -P is more powerful than -E, but not ...
0
votes
0answers
14 views

How to use RegEx modifiers within Ultraedit?

I'm looking for using regex modifiers like (/g global, /s single line, ...) on UltraEdit. I want to use them when applying Find/Replace on my files using UltraEdit. Note: I'm using UltraEdit for ...
0
votes
1answer
96 views

How to install perl in RHEL 7?

I use RHEL 7.2 and want to install perl. Executing yum install perl, it outputs the following: # yum install perl ...... Total size: 11 M Total download size: 8.0 M Installed size: 36 M Is this ok ...
0
votes
1answer
15 views

No 'Makefile' created KAMENSKY/Text-Bidi-2.11.tar.gz

I am trying to install following perl module via cpan on centos 6.x but unfortunately getting error. Please advise to solve. Text::Bidi Version: 0.03 Usage: Label batch PDF CPAN /usr/bin/cpan ...
0
votes
2answers
37 views

How to add a new line to the top of the file- OSX&GNU

i tried the below to add a new line to the top of the file but to no avail 1) seems to work but how do i do it inplace ? perl -lpe 'BEGIN{print "somestring\n"}' file 2 ) sed -i.bak -e '1i somestring ...
1
vote
2answers
58 views

Perl IRC Bot running on the machine

I had someone hacked into my linux machine and was running a perl code which seems to be some kind of a bot. The next day I got a call from ISP saying that there are large number of spam mails ...
0
votes
2answers
31 views

Unable to add spaces

How can i add spaces between my outputs using sed/echo or any other command in linux? Preferred Output: Virtual Machine Test01 status Running. Virtual Disk Test01 size 61GB Physical Disk ...
0
votes
1answer
40 views

Replace multiline string by another multiline string in a markdown file on OS X

I want to replace a multiline string in a markdown by another one (also multiline). I think perl is the best option. E.g. i want to replace ## Exercise 1 some text some more text ## Points by ...
0
votes
1answer
64 views

Perl replace string inside file with the filename?

I need to replace a string in a JSON file with the filename of that file. I successfully matched the string to be replaced using the regex below, but I can't figure out how to get the filename in ...
0
votes
1answer
17 views

Notepad++ Alternative string in Perl Regex

I am trying to implement some of my old notepad++ regex search in perl. I using following command. perl -i -pe 'BEGIN{undef $/;} ...
0
votes
1answer
26 views

Using hashes values and keys in Perl

Reads a sentence from the user using the <> operator, splits the sentence into an array of words (hint: use split(/regex/, $string), and outputs how many words there are in the sentence. Creates a ...
0
votes
0answers
24 views

Triplicate entries of a column

I have a data column with over 2000 entries... MV1 BNV CMG IKN ... ... I want to triplicate each entry in the column format. Result should be; MV1 MV1 MV1 ...
1
vote
1answer
835 views

How to add Perl modules using CPAN on El Capitan

When OS X El Capitan arrived, the ability to use CPAN to add or update Perl modules disappeared. It seems that the scripts either want to alter /usr/bin, which is now prohibited, or they try to use ...
0
votes
0answers
78 views

Convert two-byte hex string to char in perl

I have a string of two-byte hex characters and I'd like to convert them to an ascii or unicode string. The string can have a variable length. Input: $hex_string="003400300030" Desired output: ...
0
votes
1answer
32 views

How do I make a word frequncy counter case sensitive using command line interface in Perl?

So I have this Perl Script which is a word frequency counter. But now I have to modify this script and make it case sensitive. So if a user adds -i on the command line, the script should compare in a ...
0
votes
1answer
27 views

Save text from file between two given characters and save the output to file?

I have a file with the following kind of text: @ heading with some text the.actual.text.of.choice which.can.be.several.lines in.length.with.no.pattern + more.text.that.i.want.to ...
-1
votes
1answer
26 views

Weird perl + zsh-behaviour when running “for (1 .. 80000000) { print qq#$_\n# }”

I tried to run a script in a newly opened zsh-session which was $ perl -e "for (1 .. 80000000) { print qq#$_\n# }" So, I needed some time to type it in, then it took some time and did nothing and ...
1
vote
1answer
36 views

Generate CSV from NS Zone File

I have a large file that contains records in multilines. ex: domain1 NS ns1 domain1 NS ns2 domain1 NS ns3 domain2 NS dnsx What might be the fastest way to generate a CSV of the form ...
0
votes
1answer
78 views

Printing matching subgroups in a perl one liner

I have the regex[1] (/foo/bar/(GW|GREV)[^/]*).* I was able to get this to work with GNU sed with sed -n 's/\(\/foo\/bar\/\(GW\|GREV\)[^\/]*\).*/\1/p' But that was a modern GNU sed and I'm on ...
1
vote
1answer
34 views

When I run a git hook in a repo on a network share: which binaries are used?

See title. My repo is located on a network share. When I push new revs there, a post-udpate hook is run. The hook needs Perl and runs nicely. But which perl.exe is used here? The one on my machine? ...
0
votes
1answer
27 views

Cannot read output of open in Perl

I have this little bit of code in a while statement while(<PS>) and it will not execute and read the output of the open(PS,"blabla") code. How do I resolve this? #!/usr/bin/env perl # my ...
0
votes
1answer
36 views

NET-SSH2 for perl 5.20.2 on windows 2008 r2

I am trying to install NET-SSH2 for perl 5.20.2 on windows 2008r2 but no success. C:\Perl>ppm install NET-SSH2 Downloading ActiveState Package Repository packlist...failed 500 Can't connect to ...
-1
votes
1answer
36 views

bash change strings with multiple escape characters

Hello i try to automate for example change one variable in php file . root /tmp # cat defaults.inc.php|egrep "reply_all_mode" $config['reply_all_mode'] = 0; I try to first catch this by grep ...
1
vote
1answer
75 views

Perl doesn't print 0x00

I wanted to experiment with the NOP SLED technique. I got the sled and the shellcode into an environment variable and I got its address. So i wanted to execute the vulnerable program and as an ...
3
votes
1answer
34 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
56 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 ...
17
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
172 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
135 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
1k 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
30 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
74 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 ...
1
vote
3answers
915 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
41 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
171 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
152 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
60 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
141 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
224 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
104 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
1answer
93 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 ...
2
votes
3answers
1k 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
329 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
522 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. ...