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

0
votes
1answer
29 views

Install of CPAN Perl module on RHEL 7 fails (Amazon EC2)

I am trying to install x2goserver on my RHEL 7 server. I ran into dependency issues exactly like the question here, (I am not familiar with Perl or CPAN, I just want a functioning x2goserver) so when ...
0
votes
2answers
50 views

'C:/Perl64/bin/' is not recognized as an internal or external command, operable program or batch file

I installed active perl on my win2k12 server, I want to run a perl script but it showing this message, 'C:/Perl64/bin/' is not recognized as an internal or external command, operable program or batch ...
0
votes
1answer
34 views

Run and edit a Perl/Python/non-Powershell - Script in Powershell_ISE (Windows Server)

I am on a Windows Server (2012) with Powershell_ISE and befor installing additional software I wanted to edit and test a script in the Powershell_ISE (it's a better native solution than using notepad +...
1
vote
1answer
11 views

Build hash of lists, as for “all tags for id” with perl dbi

I searched around the dbi docs and googled around but could not find if there was a (dbi) native way of building up a hash of lists. The closest I can think of is fetchall_hashref but that overwrites ...
0
votes
0answers
80 views

Ubuntu 16.04 apache2: Loading perl modules yields “failed to map segment from shared object at ”

I recently upgraded my desktop to 64 bit Ubuntu 16.04. I have an apache server running mod_perl that loads a variety of perl modules for my site algebra.com. That works great in production and ...
2
votes
2answers
32 views

How can I assign (x,y) coordenates to some values?

So I basically have to assign (x,y) coordenates to some ids that will be coming from a file. Let's say the file items.txt have the following content: if-eth0-in if-eth0-out ping-status cpu-load ...
1
vote
2answers
172 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 ...
0
votes
1answer
52 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
31 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
22 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
18 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
236 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
38 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
73 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
44 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
71 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 $/;} s/\\cellx10464\\pard\\plain\\intbl\\s0\\ql\\fi0\\li0\\ri0\\sl320\\...
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
25 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
1k 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
97 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
34 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
29 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 remove.several.lines....
-1
votes
1answer
29 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
42 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 domain1,ns1,...
0
votes
1answer
95 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
41 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
29 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
43 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 ppm4....
-1
votes
1answer
37 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
80 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
35 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
63 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
189 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
150 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
33 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
81 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
4answers
1k 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: /Applications/MacVim.app/...
1
vote
1answer
48 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
179 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
163 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
61 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
148 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
241 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
113 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
103 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 ...