Perl is a high-level programming language that comes installed by default in Ubuntu. It is well known for it's use for text manipulation, CGI scripts and it's huge community. You can find any modul and many tutorials on http://www.cpan.org/

learn more… | top users | synonyms

0
votes
1answer
10 views

How to edit INC with latest library in perl

How can I avoid the error below when running a Perl script? Can't locate YAML/XS.pm in @INC (@INC contains: ../../../YAML-LibYAML-0.35/blib/lib/YAML/XS.pm /app/utp/utp/apps_oper/perl5lib ...
1
vote
1answer
19 views

How to install the PHP/Serialization module in Perl?

When running nfsen, my logs display: nfsen[24213]: ERROR: Can't locate PHP/Serialization.pm in @INC (you may need to install the PHP::Serialization module) (@INC contains: /usr/local/nfsen/plugins ...
0
votes
1answer
27 views

Running Multiple perl script simultaneously

I have three identical perl script; say test1.pl, test2.pl, test3.pl Each perl script have a set of commands. For example; command to run test1.pl perl test1.pl arg1 arg2 &; test1.pl ...
2
votes
2answers
83 views

Search for number sequence

say you have a file1.csv containing 5 million lines, each line has 8 random numbers separated by comma. And you have this sequence 7,152,13,11,42,5,7 How to output the lines in file1.csv containing 3 ...
1
vote
0answers
58 views

apt-get is broken in 15.04. I can't install anything. Perl errors [closed]

I have managed to break my apt-get. When ever I try to install a package I get the following error. Any advice? I am a bit of a noob when it comes to apt. ➜ ~ sudo apt-get install nodejs Reading ...
0
votes
0answers
17 views

is there an archive for old questions ? (am looking for a perl-script we together have written) [migrated]

I am looking for 2 different perl-scripts the askubuntu-users and me have together written for usage in systemlog. Is there an archive of perl-scripts which were tested and successfull in 2012 and ...
0
votes
1answer
13 views

Is there a way to force Perl to always use the latest version?

This is in relation to this question: Why doesn't Perl use latest version by default? I'm aware that I can force it with use v5.14 from within a script, and that's what I'm currently doing, but ...
1
vote
2answers
29 views

roundign numbers perl [closed]

a vector I have looks like this v<-c(1,7,9,15,22,29,30,30,30,30,40,42,49,50,50,50,55) as I cant allow for numbers appearing more than a single time I would like to be the output like v ...
-1
votes
1answer
26 views

read numbers with e in awk

Hello a file I am working with looks: header // SeqT: {"POS-s":174.683, "time":0.0130084} SeqT: {"POS-s":431.49, "time":0.0221447} ...
1
vote
2answers
166 views

How can I divide an output with 2 delimiters?

By dividing with the "·" and " " characters, I would like to turn this: Hel·lo my name is E·ric To this: Hel·lo my name is E·ric Hel·lo my name is E· Hel·lo my name is Hel·lo my name Hel·lo my ...
0
votes
0answers
22 views

How to check if a switch is configured in 'ssh' or in 'telnet' using perl script provided the switch IP is available…?

In a perl script, when a switch IP is available, it is required to know if the switch is configured for 'ssh' or 'telnet' for continuing execution. How can this be done..? Please help it...
0
votes
2answers
80 views

Trying to execute a run.pl file

I am trying to run a run.pl file form the OpenDroneMap directory using the command ../OpenDroneMap/run.pl from within the Photos directory however I keep getting a Bash error. Would there be any ...
0
votes
1answer
43 views

split files with specific pattern

A file I work with is like NAMES n0 n1 n2 n3 n4 n5 n6 n7 REGION chr 1 100000 404 AAAAAAGA 992 TTTTTTTA 1146 CCCCGGCC 1727 CCCCCACC 1778 GCCCCCCC My desired output is (please ...
1
vote
1answer
66 views

How to add command line options to perl script? [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, ...
0
votes
0answers
40 views

Locale warning from Perl stops Postgres configuring

So I want to set up Postgres on a Microsoft Azure-server running Ubuntu 14.04. I need to make a cluster: user@mysystem:~$ pg_createcluster perl: warning: Setting locale failed. perl: warning: Please ...
3
votes
3answers
137 views

apt-file regex: escaping a dot

I want to find all packages which provide a shared object containing "ssl" in the file name. The apt-file manpage says: --regexp | -x Treat pattern as a (perl) regular expression. ...
3
votes
4answers
245 views

Bash create custom string

how could in bash a pattern like ROW1 n1 n2 n3 n4 up to 300 be done with some command in bash or also just perl...the delimiter would need to be \t as above
1
vote
1answer
68 views

diffrence between two files of different row numbers

Yesterday I asked this question, and got awesome answers, it's really a joy to ask questions on this site. Today I got a slightly different question say I have csv1 1,2,3,4 5,6,7,8 -- 9,10,11,12 ...
0
votes
4answers
76 views

matrix operation in bash [closed]

the point is that I woul need to transpose a large file - 1600 times 80k but the entries are not tab delimited but just U and K so it looks like UUUUTTTUTUTUUUTUTUT TTUTUTUTUUTUTUTUTUT is there a ...
-5
votes
1answer
137 views

code matrix to letter [closed]

a txt file I have looks like this 1 3 6 7 9 11 000000 100001 000101 110100 000100 the recoded version should be UUUUUUUUUUU YUUUUUUUUUY UUUUUUYUUUY YUYUUUYUUUU UUUUUUYUUUU for this the first ...
1
vote
2answers
38 views

How to to fetch kernel errors in Ubuntu..? [closed]

I a trying to make an alert e-mail system using Perl Script, when a kernel error occurs in a server. How can I fetch serious error logs from the kernel? Logs can be seen in /var/log/kern.log The ...
2
votes
1answer
64 views

Why does Perl always need the “-p” option to be given even when the input file is stdin?

Update #2: I had a great missunderstanding about the -p option, now it's clear to me that it's used to process all the files provided as an argument, but I still don't quite understand why this is ...
-1
votes
2answers
217 views

How to ssh using perl scipt,run a command, and return the output…?

As clearly explained in the question, kindly give me an option to ssh to a machine using perl script, run a few script lines there, and return the output to the source machine. Found out a few docs ...
0
votes
1answer
52 views

how to fix error perl -e exit?

perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LC_PAPER = "id_ID.UTF-8", LC_ADDRESS = "id_ID.UTF-8", ...
3
votes
1answer
167 views

How to enter a declared variable in the mail body, while sending mail using perl script?

I am sharing a perl script here, which is supposed to send a mail with the HDD/RAM status in the message body: Also, the HDD out will happen only if the %HDD use is above 50%. How can I include the ...
1
vote
1answer
189 views

can't install cpan module GD

Since I failed to install Image::Magick on my non-GUI Ubuntu server Ubuntu 14.04.2 LTS (read about it here), I tried to install another image-manupulation tool that can be used from a perl-script: GD. ...
2
votes
6answers
261 views

How can I extract text between a pair of the same character?

Input: blahŤfoobar1Ťblah Desired output: foobar1 I want to get the text between two "Ť" characters. Assume there will always be either 0 or 2 "Ť" characters, to make things easier. I tried the ...
2
votes
1answer
91 views

How to make a bootable pendrive in command-line?

How could a Bootable USB Pendrive can be created using the Ubuntu command-line. Can we use a script for the same? Can somebody help on this?
2
votes
0answers
263 views

Apache 2.4 and mod_perl 2 on Ubuntu 14.04: local configuration

I'm trying to get Apache 2.4 configured such that I can test mod_perl 2 code locally (I should note that I have little recent experience with Apache). I've installed both of them on a machine running ...
0
votes
1answer
112 views

How to create a perl script which checks the system stats(CPU,RAM,HDD) and sends an alert mail? [closed]

The script is for adding to the cron tab. The flow of the shell script should be like this. 1. Checks the CPU state. 2. Checks the RAM usage. 3. Checks the HDD usage. 4.Sends an alert mail to ...
-1
votes
1answer
63 views

How to compare/fetch the greater value in perl script? [closed]

Trying a perl script to fetch the % of hard disk usage. [By fetching the 5th column of the 'df -H' output, shows percentage of use]. $thirdlast=`df -H`; @matches=($thirdlast=~/(\S+%)/g); print ...
2
votes
1answer
147 views

Using awk command in perl script [closed]

Can somebody suggest how to use piping of commands in a perl script? Specifically commands that involve calling awk? I'm trying to create a perl script that will read disk usage using df -H and ...
2
votes
4answers
276 views

Parse lines with specific pattern out of file

I have a file that looks roughly like this : [25]:0.00843832,469:0.0109533):0.00657864,((((872:0.00120503,((980:0.0001 [29]:((962:0.000580339,930:0.000580339):0.00543993 ...
2
votes
2answers
49 views

How can I put a cluster lines in numeric order?

How can I convert this: -foo -bar 42 \ randomtext=00 "00" \ -randomtext=00 "00" \ -foo -bar 104 \ randomtext=00 "00" \ -foo -bar 1 \ -randomtext=00 "00" \ To this: ...
3
votes
0answers
110 views

Perl package not found with apt

When I try to do an upgrade or install something, apt(-get or aptitude) throw an error, saying that perl can't find XML/SAX/Debian.pm while trying to configure libxml-libxml-perl. Here is the full ...
1
vote
2answers
933 views

Can't locate LWP

After recent upgrade I can't launch only one of my apps it always gives me this error: Can't locate LWP/UserAgent/Cached.pm in @INC (you may need to install the LWP::UserAgent::Cached module) (@INC ...
2
votes
1answer
440 views

Perl .pl file downloads instead of being executed

I'm trying to get OTRS 4.0 working on Ubuntu 14.04. I've followed all instructions to install from source. When I open the site (localhost/otrs/index.pl), an empty .pl-file is served for download. ...
2
votes
2answers
47 views

Output of a Perl one-liner [closed]

I have a perl one-liner: perl -pe 'while (/((\(.*?[^)]\))|(".*?"))/g) {print "$1 ";} print "\n"' testdata The file testdata contains the following: "123" (123) 123 Ouput is: "123" (123) "123" ...
5
votes
8answers
610 views

How can I delete text that is NOT in quotes or parentheses?

Input: 19. "foo foo" (bar bar) (19) raboof "foo foo" raboof Expected output: "foo foo" (bar bar) (19) "foo foo" As you can see, I would like to keep the double quotes and parentheses. ...
18
votes
5answers
475 views

How can I merge files on a line by line basis?

cat file1 foo ice two cat file2 bar cream hundred Desired output: foobar icecream twohundred I already have a solution involving a for loop with sed using the line number of the files, but in ...
5
votes
2answers
379 views

useradd doesn't allow the user to log on

On an Ubuntu 14.04.2 LTS the following command: adduser fu and then entering a password bar and just pressing Enter on all other questions, creates a user that allows me to log on and has the ...
1
vote
2answers
69 views

parsing out in bash

my file looks like this // [297]((((21:0.125204,20:0.125204):0.00994299,(28:0.0790047,(7:0.0146105,5:0.0146105):0.0643943):0.0561423):0 segsites: positions: 1 2 4 6 9 10 45 67 78 89 ...
-1
votes
2answers
470 views

Unable to locate package perl(Net: & IO::Socket:)

When i am trying to use following command it shows following error root@RR-DE-NMS-1:~# apt-get install 'perl(Net::SSLeay)' 'perl(IO::Socket::SSL)' Reading package lists... Done Building dependency ...
1
vote
0answers
134 views

list all files in parent and sub directory using perl [closed]

$dir="/home/httpd/cgi-bin/r/mera"; $dir1="/home/httpd/cgi-bin/re/plan"; opendir(DIR,"$dir")||die"error"; while($line=readdir DIR) { print"$line\n"; opendir DIR1,"$dir/$line"||die"error"; ...
3
votes
4answers
264 views

Replace string with multiline file content

I need to replace string SALT in a file with content of another file. Problem is that the input file has multilines. I tried something like this in my bash script: SALT=`cat salt.txt`; sed ...
3
votes
4answers
101 views

Find and replacement of the numerical part of a particular string with increased value using terminal command [duplicate]

The inputfile is, test00.dat test07.dat test03.dat aram22.dat test09.dat aram09.dat test13.dat I need the output file as test01.dat test08.dat test04.dat aram22.dat test10.dat aram09.dat ...
1
vote
1answer
65 views

Command-line perl regex replacement: replacement string contains utf8

Say you have a file named test.txt with the following lines: ಕದಂ.ಬ कदम्ब. Then, suppose you want to replace each dot following a devanagarI unicode character (ie in कदम्ब) with a ।. Then, you might ...
1
vote
1answer
96 views

Find and replace regular expression (matching unicode character class Devanagari) in multiple files

Say you have a file named test.txt with the following lines: ಕದಂಬ कदम्ब Then, suppose you want to replace each devanagarI unicode character (ie in कदम्ब) with a D. Then, you might think that the ...
0
votes
0answers
22 views

problem in creating own module for reuse

i wish to create my own module and i want to use that module name for further use, the main concept is, create a module which should contains subroutines for line count, word-count and character ...
0
votes
0answers
12 views

Using switch statement with Ubuntu in Perl [duplicate]

I am an IT student and taking UNIX/Perl class. I am using vi to write Perl program with a switch statement. I am running into this error: "Can't locate switch.pm in @INC (you may need to install the ...