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
1answer
11 views

perl + uniq characters before variable

Please advise What is the meaning of the characters "%%" before the variable EOF ? $LINE =`tail -1 $FILE `; chomp($LINE); if ($LINE eq "%%EOF") { . . .
2
votes
4answers
39 views

Merge lines between keywords into one-line comma separated values

Between first occurrence of Cat to next occurrence of Cat, it should create a separate line with delimiter as ",". File input as below. Cat AA BB CC Cat AA-1 BB-1 CC-1 Output expected: Cat,AA,BB,...
6
votes
4answers
412 views

How can I blank the nth to mth field using the awk command?

I would like to solve the problem below using AWK. If any other solutions are possible using languages such as sed or Perl, that would also be much appreciated. Below is the input: U,N,UNIX,000,A,5 ...
8
votes
4answers
30k views

compare two columns of different files and print if it matches

I am using solaris 10 and Grep options involving -f doesnt work . I have two pipe separated files: file1: abc|123|BNY|apple| cab|234|cyx|orange| def|kumar|pki|bird| file 2 : abc|123| kumar|pki|...
0
votes
1answer
31 views

How to run a perl script inside another perl script

I have two Perl scripts and want to use one script from another. The scripts are called script1.pl and script2.pl. I want to run the below command inside script1.pl : /home/user/script2.pl /var/log/...
0
votes
0answers
19 views

how to link excel sheet to perl by moving excel sheet to some directory in pc that should be in our network [closed]

in order to link the excel sheet to perl script in order to reflect changes made in excel sheet we have to move that excel sheet to some other place in our pc like some other directory am not sure. so ...
3
votes
1answer
40 views

How can I completely reinstall Perl on Debian without having functional Perl?

Long story short: I made a pretty ridiculous stupid error when trying to configure CPAN that resulted in me having two half-versions of Perl, both of which are missing important packages. In ...
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 (cpan,...
0
votes
0answers
18 views

how to access xls sheet through perl script [closed]

To access the excel sheet through perl how that can it be done? where to add that excel sheet so that it can be accessed.
1
vote
1answer
15 views

how to see the changes made in a big perl script having the copy of original that is to compare both in a splitted gvim editor simultaneously

In a particular perl script and I have a copy of the same but with the changes made in it i want to see both the scripts in such a way that changes made in the copy to be highlighted in a split gvim ...
-1
votes
0answers
17 views

perl error: Global symbol requires explicit package name [migrated]

while executing the perl script which is accessing the xls sheet I got this error: Global symbol "$mux_reg_name_col" requires explicit package name at Clk_verif_gen.pl where $mux_reg_name_Col is ...
0
votes
2answers
113 views

Apache 2.4.10 page not displayed

I'm not a big expert in Apache and I facing with a particular problem. I have 2 server where in the first I run Debian 7.9 with Apache/2.2.22, in the other one I have Debian Apache/2.4.10. In both ...
13
votes
2answers
460 views

How should I check whether a given PID is running?

I'm writing a Perl script that parses logfiles to collect PIDs and then checks whether that PID is running. I am trying to think of the best way to make that check. Obviously, I could do something ...
-1
votes
1answer
21k views

convert CSV to XLS file on linux [closed]

The following Perl script can convert CSV file to XLS file the problem is that I need to install on customer Linux machine many Perl modules in order to run this Perl script , and actually I cant ...
0
votes
3answers
45 views

Print/export csv file into array

I have the following data in a very large csv: "sortorder","name","description" "1","B.1","Boiler room" "2","1.1","First office" "3","1.2","Second office" etc... Which I would like to end up in ...
0
votes
0answers
18 views

How to add a # to the begining of a line, only specific lines that I grep for [duplicate]

I have a file that has many thousands of lines. I what to comment out only specific lines in the file. I want to add a "#" to the beginning of the greped for line plus 2 lines above and one line below ...
0
votes
1answer
43 views

Build a sitemap from local PHP forum pages

I've been reading stackexchange for years now, and always managed to find an answer to the problems I had to deal with. This time however, I'm going to ask a question as I could not find a solution to ...
2
votes
2answers
121 views

Text manipulation: Extract everything inside brackets

I have a text file where every line is in a similar format to this: %#&#%# [Dinero] / Money / !#@%$@ [Dia] / Day / $%&$^#@ [Perro] / Dog / I am looking to extract the words ...
2
votes
5answers
311 views

Reducing the complexity of the data in text file

I have this file: 1 2 2 7 3 4 4 7 5 3 6 7 7 1 8 2 9 4 And my desired output is 1 13 2 17 3 7 In my input i have 9 rows and i want to reduce it to three rows while ...
2
votes
1answer
33 views

Perl: General way of finding size of block device

I use -s regularly to find the size of a file. It works cross platform. Is there a similar well tested way of finding the size of a block device? We are not talking the size of a filesystem or the ...
-1
votes
0answers
22 views

Filter two file extension in if statement in perl script

How do I filter file extensions .csv and .CSV in an if statement? Below testing failed. 67 opendir ( DIR, $source ) || die "Error in opening dir $source\n"; 68 69 foreach my $fileName (readdir(...
2
votes
1answer
4k views

Apache cannot fork: cannot allocate memory

I am running apache on Fedora with mod_perl. The server forks a process to send an email frequently - and the fork exits. Suddenly, I got: Cannot fork: Cannot allocate memory. There was plenty of ...
1
vote
1answer
17 views

How to permanently set some path in @INC

I want to set a path in @INC, as script is failing to locate perl module. Requirement is that , i cannot include the module path in the script directly. So , i am thinking to add module path directly ...
0
votes
1answer
1k views

AWStats on Debian Jessie Forbidden from Browser / Unresponsive from CLI

I asked this on SO a day or two ago and no response yet. Hoping for some insight here in getting AWStats configured and running on Debian Jessie. Installed AWStats with apt-get install awstats. No ...
1
vote
1answer
616 views

How can I get mod_perl running in Arch Linux?

I've installed mod_perl, and even tried enabling it, unfortunately it seems to be preventing apache from starting. LoadModule perl_module modules/mod_perl.so here's the error. /usr/sbin/apachectl: ...
2
votes
1answer
42 views

redirect output of command to /dev/null

I run the following line from my bash script in order to run the script /usr/run.pl on remote machines xargs -P "$numprocs" -I '{}' -n 1 -- perl -e 'alarm shift; exec @ARGV' -- "$timeout" ssh -...
0
votes
2answers
231 views

How to update three CSV files based on a fourth file

I have four csv files, and I want to update a set of three, based on the values in the fourth file. file_1 contains names. file_2 their numerical ids. file_3 contains ids from file_1 and file_2, ...
-2
votes
2answers
9k views

how to run perl cgi script on apache [closed]

I Successfully installed Apache web server in my local machine. My question is how to run perl cgi script on this server Actully I don't have any Idea that's why posted question here. my sample cgi ...
7
votes
1answer
378 views

Passing clicked links in rxvt to a script

I start my browser vimprobable in tabbed like so: "`tabbed -d > /tmp/tabbed.xid`; vimprobable2 -e `cat /tmp/tabbed.xid`" [1] I am then able to send all new instances of vimprobable to tabbed (and ...
0
votes
1answer
43 views

Split xls file into small xls files [closed]

I want to split the sample.xlsx (containing 3 sheets) file into the 3 different sheet1.xlsx sheet2.xlsx sheet3.xlsx files , I have John McNamara Perl package repositories VERSION = 2.37. I am adding ...
2
votes
3answers
44 views

rename(1)-like script in Perl, but for copying files?

So there's this rename(1) Perl thing. It suits my task precisely, except that I need it to basically cp files instead of mv. How to achieve that? I have quite a few rules of renaming, all expressed ...
1
vote
2answers
84 views

Perl stripping substring with $ in front

I get that perl thinks the part of the string with $ are perl variables. What I'm trying to do with the perl call, is redefine variables preceded by a $ as \$, but that's throwing other errors. I ...
0
votes
0answers
35 views

Trying to execute vim function from plugin - can't get syntax correct

I found a pretty neat VIM plugin which adds functionality for managing Perl scripts; it's called Perl-Support. I got it installed fine, and I'm trying to take advantage of all the custom functions/...
1
vote
1answer
4k 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 ...
2
votes
1answer
36 views

Tweak perl script for human-readable dmesg output

In RHEL 6 I have the kernel parameter: printk.time=1 So that my dmesg would have a timestamp. However it shows in seconds from restart, like this: [12.23456] I found a script that you place ...
0
votes
1answer
55 views

How to submit multiple commands as one liner in netbatch nbq commmand line

As title can someone tell how to submit a one liner command using nbq command line? Submitted multiple commands in Linux works fine but not in nbq mode as below. find /nfs/disks/test_dir/ -name ....
-2
votes
2answers
39 views

Data Manupulation required your help

I have a data as mentioned below. host_name Server1.domain.com contacts DL - Desktop contact_groups ravi, raj, rahim host_name Server2.domain.com contact_groups DL-Server host_name Server3....
1
vote
1answer
41 views

sh script containing perl element does not produce same output via crontab as manual execution

I tried posting this on Stackexchange but I think I may have more chance of a correct answer here as its very linux specific. I have an sh script which updates data in a csv, then runs a perl script (...
6
votes
1answer
88 views

Perl one liner to find words longer than 63 characters

I have a number of XML files containing sanskrit texts to be converted to tex. Latex has a maximum of 63 characters per word for its hyphenation to work, everything longer than that will not be ...
2
votes
2answers
43 views

Adding 'exception' words to the rule of perl matching titles script

I have been using this perl script (thanks to Jeff Schaller) to match 3 or more words in the title fields of two separate csv files as answered here: Matching 3 or more words from fields in separate ...
0
votes
0answers
41 views

Padre (perl IDE) package not found under Centos7

I wanted to install Padre the Perl IDE under CentOS7. I followed the Fedora page on the Padre wiki : http://padre.perlide.org/download/fedora.html It just says install is done through: # yum ...
3
votes
6answers
1k views

How do I remove a words ending in the letter S if duplicates without an S on the end are on the same list?

I have a large list of words. Many of the words are only different because they have the letter s on the end. If a word on the list is the exact same as another word on the list, except one of the ...
3
votes
2answers
86 views

Organizing three dimensional data with awk/sed/perl

I have this file (a sparse matrix): PC.354 OTU1 6 PC.354 OTU2 1 PC.356 OTU0 4 PC.356 OTU2 7 PC.356 OTU3 3 I want an output like this (dense matrix -classic .biom table): OTU_ID PC.354 PC.355 PC....
3
votes
5answers
318 views

Increment index in file

Alright, it seems I cannot find a way to do what I need. Let's say I have a text file A like this (freqBiasL2[27]) (SatBiasL1[27]) (defSatBiasL2_L1[27]) (defSatBiasSlope[27]) (...
1
vote
1answer
36 views

timestamping history file causing erroneous lines in history command

I have .bash_profile setup to export to a history file: export HISTFILE=/root/history/.bash_hist-$(who -m | awk '{print $1}') Then I am exporting time stamps for the history command. export ...
4
votes
4answers
147 views

Replace strings in a file based on a list of strings and a list of corresponding replacements

I am trying to replace strings in a file A: Hello Peter, how is your dad? where is mom? where the strings to be replaced are in file B: Peter dad mom and their corresponding replacements are in ...
-3
votes
2answers
51 views

linux + convert file format columns to one column

I have the following file (Linux.txt) linux-test01 linuxER LinuxCV LinuxWE LinuxPL LinuxDF LinuxXC LinuxSD LinuxAQ how to print using awk or perl one-liner to produce the following ...
2
votes
3answers
195 views

sed regular expression behaving differently than in vim and perl?

Here's a sample 'test.txt' abcdX1yad45das abcdX2fad45das abcdX3had45das abcdX4wad45das abcdX5mad45das sample desired output: X1yad X2fad X3had X4wad X5mad I could get it working in vim with: :% ...
1
vote
0answers
21 views

MOZREPL output showing up in terminal window

I have a very a annoying problem. I've using Mac Terminal over SSH to write Perl script with vim on a local virtual Debian machine. The Perl script uses the WWW::Mechanize::Firefox module which in ...
1
vote
3answers
37 views

How to add the aggregated numbers in a file

I need to write a script which will add the values for the same string in different lines. For example when a file contains the following: abc,10 xyz,20, abc,30, ghd,40 xyz,10 script should check ...