Perl is a high-level, general-purpose, interpreted, dynamic programming language. It was originally developed by Larry Wall as a general-purpose Unix scripting language to make report processing easier, over a period with support from open source community, it has evolved and matured to be used for ...

learn more… | top users | synonyms

1
vote
5answers
42 views

Making a *nicely* formatted list of number of files in directories - awk & sed probably

I have lots and lots of files in a series of directories, and would like a nicely formatted list of how many files are in each directory. The directories are ordered thus: Parent directories named ...
0
votes
1answer
15 views

Execute Perl commands from a specific IP?

I have a Debian Jessie 8 server with three unique IPv4 IPs. I connect to the server from Windows 7 via Putty. I can open three Putty windows using each of the three IPs. I am trying to execute a Perl ...
2
votes
1answer
19 views

Why isn't rxvt-unicode launching with perl extensions enabled by default even though I built it with '--enable-perl' and even '--enable-everything'?

I'm trying to get 'clipboard' perl extension for urxvt to work. I installed the script, it didn't work, and after some searching around I discovered that Cygwin's rxvt-unicode package is built with ...
1
vote
2answers
19 views

Perl script in bin that calls a file

I have a script ~/bin/script $ cat ~/bin/script #!/bin/bash perl -pe 's/loremipsum/`cat ~/foo/bar/file.txt`/ge' -i ~/path/to/target.txt The script is supposed to replace every instance of ...
0
votes
1answer
22 views

Script to remove certain span elements from an HTML file

I want to write a script that completely removes every instance of a particular span class from a given HTML file. For example, if my undesired span class is "foo" then running my script on the file ...
0
votes
1answer
22 views

Perl one-liner to replace a code block

I have a file foo.txt hello world first line to change second line to change I would like to write a perl one-liner that changes foo.txt to read hello world this is my ...
0
votes
2answers
30 views

Breaking up a file into two parts based on a particular line [duplicate]

I need to breakup a file into two separate files based on a particular line for example: . . sc_outfifo 0.000E+00 0.000E+00 0.000E+00 0.000E+00 1.586E-02 1.586E-02 1.586E-02 Fub_Level_DACGE(%) ...
1
vote
0answers
100 views

Perl Script to Display Pork Offline Message

I use pork 0.99.8.1 on openSuse 11.4 for my AIM account when I don't want to use irssi + bitlbee. The only problem I have encountered so far is that offline messages are not displayed. I just get a ...
1
vote
1answer
20 views

perl library getopts.pl

I'm trying to install a program, but keeps giving an error saying it doesn't find the perl library getopts.pl. My perl version is v5.16.2. The error message is: Can't locate getopts.pl in @INC ...
1
vote
2answers
20 views

Script that only counts Established, TIME_WAIT, and Closed Wait connections using Netstat

I'm trying to make a script (using Perl, but it isn't necessary) that will only count the number of Established, Time_Wait, and Closed_Wait connections on a system and print them in terminal. So far ...
0
votes
1answer
49 views

Bash will not execute system command in Perl script

Need a Bash file to run a perl script. This is the Perl file. #!/usr/bin/perl -w use strict; system "fastacmd -s $Q -d $NewQuery -o ./gifiles/$Q.$NewQuery.txt"; I have left alot out to avoid ...
1
vote
1answer
588 views

How to start a perl webserver with systemd?

I copied this this file (vokabel_daemon.service) [Unit] Description=Start vokabeltrainer daemon After=network.target [Service] ExecStart=/home/mm/lib/vokabeltrainer/box_vokabeltrainer.pl daemon ...
2
votes
1answer
58 views

Make a rpm package from the cpan compatible tree?

I always make my perl module following the CPAN-complient tree. I would like to use this tree to create a rpm file I could install on a hundreth servers. Is it possible to make a rpm package with ...
2
votes
0answers
8 views

apt-get upgrade with /usr/bin on aufs fails to create backup link

I'm trying to update a frugal persistent (root and home) install of antiX-15 x64 from stable to testing. I changed the source lists and ran apt-get update. apt-get upgrade then fails with the ...
1
vote
1answer
40 views

add pairwise values looking up from a file

I have several variables (col1) which have 3 values (col 3,4,5) for some levels (col2) mango123 L1 1 2 3 mango123 L2 4 5 6 squash378 L1 7 8 9 squash378 L5 10 12 13 squash378 L15 0 1 3 ...
1
vote
1answer
2k views

“Requires: perl(:MODULE_COMPAT_5.8.8)”

I use CentOS 6.5 for my server with below repository: IUS epel ces-standard-* base/upgrade/extras When I tried to update today (it's been a while I haven't updated this server), I got the ...
8
votes
5answers
15k views

invalid SSL_version specified at /usr/share/perl5/IO/Socket/SSL.pm line 332

Since I upgraded my PC from (k)ubuntu 12.04 to 12.10 I receive this error message when trying to send an email using sendemail. Installing an older version of IO::Socket::SSL is not an option. I ...
0
votes
1answer
1k views

How to convert XML file to CSV using Perl?

I'm looking for some suggestion to convert the .asn1 (CDR Data) to CSV to load to tables. As per current approach I'm using informatica B2B parser to parse the ASN file to XML than using XSD loading ...
16
votes
2answers
512 views

Security implications of running perl -ne '…' *

Apparently, running: perl -n -e 'some perl code' * Or find . ... -exec perl -n -e '...' {} + (same with -p instead of -n) Or perl -e 'some code using <>' * often found in one-liners ...
1
vote
2answers
855 views

bash bad interpreter and permission denied

I installed RHEL 5.1 on a virtual machine. I would like to install VMware Tools, but I keep getting an error. I am performing the installation via the tar procedure. I get the following error: bash: ...
1
vote
0answers
33 views

Daemonize a perl script at startup Linux

I have a custom version of CENTOS that I need to run a perl script as a daemon in at all times. To do this I want to get it to run on startup as a daemon. When the machine is on I can daemonize the ...
0
votes
2answers
48 views

How to detect and remove newline character within a column in a csv file?

I have a large (2 Million rows) csv file exported from a SQL Server database. I don't have access to the database, and there's some newline character within a column, which makes it difficult to ...
-1
votes
2answers
35 views

How to remove line break if line character count less than n chars [closed]

Could anyone help me to concatenate the line with next line if the line char count is less than x chars.
3
votes
2answers
122 views

Using bash variables in perl command in bash script

I am trying to generate a hashed password as in /etc/shadow file, using bash script. The user is prompted for the password which is saved in a variable PSWD. I have extracted the Hash and the salt ...
0
votes
1answer
51 views

Search script ignores robots.txt

I am using Perfect search and it seems to ignore the robots.txt file. Any ideas what's wrong? I get the same error message. I need 10 reputation points to post more than 2 links. So I'll make note ...
0
votes
0answers
78 views

Problem accessing robots.txt from search script

I have been using the Perlfect Search Script http://www.perlfect.com/freescripts/search/ for several years on my sites. For reasons unknown it stopped working properly a few months ago. When I run the ...
2
votes
3answers
501 views

Get last set of non-empty lines

I'm running a cron job which should get only the last result of iostat -d 1 2. This requires some parsing: What is the simplest way to get the last set of non-empty lines from standard input to ...
0
votes
2answers
2k views

Failed dependencies trying to install package 'libxml2'

I am trying to install libxml2, but my system complains about dependencies. The dependent packages exist on system. The ultimate goal is to install xml_grep2, I have been trying various methods ...
104
votes
3answers
219k views

How can I replace a string in a file(s)?

Replacing strings in files based on certain search criteria is a very common task. How can I replace string foo with bar in all files in the current directory? do the same recursively for sub ...
-2
votes
0answers
29 views

Setup bugzilla alerts using gmail on Bugzilla 5.0

How can I Setup bugzilla alerts using gmail on Bugzilla 5.0? The procedure described here worked nicely, but since 5.0 the SMTP::TLS on the mail_delivery_method won't list on the drop down even after ...
0
votes
0answers
38 views

Drawing a histogram from a bash command output

I have the following output from a miRNA Predictor: Read Sequence:hsa-miR-576-3p MIMAT0004796 (22 nt) Read Sequence:gi|182396|gb|M74088.1|HUMFAPAPC Human APC gene mRNA, complete cds (8972 nt) ...
2
votes
2answers
43 views

Grouping lines into heterogeneous subsets

I have file with n lines.  (Each line refers to a “question”, and therefore they are labeled Q.1, Q.2, Q.3, ..., Q.n.)  Each line (question) has a “Marks” attribute, which has the value 2, 3, 4, 5, or ...
6
votes
2answers
388 views

Trying to do arithmetic in Perl rename tool (Debian)

Let's suppose I have five mp3 files: 01-trackfoo.mp3 02-trackbar.mp3 03-trackbaz.mp3 04-trackabc.mp3 05-trackxyz.mp3 Now I give a quick listen to the files (just mplayer on console will do the ...
2
votes
5answers
209 views

Perl script to compare two consecutive lines for the first character and ignore the second line if both first characters are same

Can anyone help how to compare two consecutive lines from a text file for the first character and if both the first characters are same ignore/delete the second line and print into new file only the ...
0
votes
2answers
80 views

get values which only ocurre once in the vector

there is a vector of numbers I have which ascend (it is called t8_) 2 7 8 9 11 15 34 91 91 92 94 the problem is that some number happen two times - I don't want to remove them but they have to ...
9
votes
7answers
7k views

How to insert the content of a file into another file before a pattern (marker)?

File1 contents: line1-file1 "1" line2-file1 "2" line3-file1 "3" line4-file1 "4" File2 contents: line1-file2 "25" line2-file2 "24" Pointer-file2 "23" ...
1
vote
2answers
29 views

How do i have my script execute one more command after a previous command returns a non-zero value before it is aborted?

I have a shell script that calls on a Perl script to do some file processing. The Perl scripts exits with either a zero or one value. I have the Unix set -e command at the beginning of my script to ...
4
votes
2answers
229 views

Reorder Multiple Line Blocks with Sed

I am trying to reorder generated output as follows; given a tex fragment as follows, I want to move the /^Constant/ down below /Dummies/, with the line before and after /^Constant/. Further, I would ...
2
votes
1answer
30 views

String concatenate in perl?

I apologize if this question is too basic, but I'm really very very new to perl. Now I want to write the following two lines of code in one line: perl -e 'print crypt("my_password","\$6\$my_salt\$")' ...
3
votes
4answers
6k views

Extracting column from comma separated text

I have a long comma-separated delimited file with 20K lines. Here's a sample: "","id","number1","number2","number3","number4","number5","number6","number7" ...
-1
votes
1answer
29 views

modify perl output [closed]

currently I have the following script #!/usr/bin/env perl use strict; use warnings; my %seen; my $header = <> . <>; print $header; my $last_sequence_number = 0; open( my $output, ...
1
vote
1answer
74 views

how to replace a sed expression (change and print only matched line) with a perl expression?

I am trying to move to perl (from sed). But how can I replace this sed expression with perl in a similarly short way? sed -n '/patternmatch/s%stuff%changed%p' file The only way I could do it was ...
1
vote
3answers
72 views

Match beginning of a line with something there?

I want to match the beginning of lines where the line contains something. Command in Perl/Sed 's/^.?/\section{}/g' but the problem here is that it replaces also the first character of sentences. ...
1
vote
2answers
97 views

how to replace a sed/perl expression (change and print only matched line) with a python expression?

I have asked this question to learn how perl could replace sed. Now I want to know how the following commands (which do the same thing) would look like for python: sed -n ...
0
votes
0answers
10 views

How to run Padre after installing via cpanm?

./cpanm Padre It looks like I could successfully install Padre. But.. How can I start it? I installed it with a normal user, not root.. where is the start script? [user@notebook ~]$ find . -type f ...
1
vote
0answers
34 views

Squid JavaScript injection problem [closed]

I got Squid up and running on my Debian machine. I tried connecting and it works, but the url_rewrite_program function does not work! Here is my Perl script: #!/usr/bin/perl $|=1; $count = 0; ...
35
votes
2answers
22k views

Getting “Not found” message when running a 32-bit binary on a 64-bit system

I have currently a strange problem on debian (wheezy/amd64). I have created a chroot to install a server (i can't give any more detail about it, sorry). Let's call its path /chr_path/. To make things ...
2
votes
1answer
661 views

Perl /Sed replacement

Below command is used to replace the password in a script but the perl command is adding a white space when it does the subsstitution password=arche20 perl -i -p -e "s/^(password[]*=[ ]*).*$/\1 ...
1
vote
1answer
27 views

detect interface name with perl

I want to detect the interface name (can't use udev because of hardware reasons) and do things according to it. Basically this should be a first check if the wifi device is able to "see" anything. ...
1
vote
3answers
50 views

compare multiple files(more than two) with two different columns

I have four different files: file1, file2, file3, file4. Each file has 2 different columns separated by tab. I want to match first column of file1 (as reference) with the first column of second file, ...