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

3
votes
4answers
220 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
59 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
62 views

matrix operation in bash [on hold]

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
127 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
votes
1answer
26 views

How to to fetch kernel errors in Ubuntu..?

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
42 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
64 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
30 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
111 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 ...
0
votes
0answers
87 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
228 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
66 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
87 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
68 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
41 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
71 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
164 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
47 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: ...
2
votes
0answers
73 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
182 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
110 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
36 views

Output of a Perl one-liner

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
533 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. ...
17
votes
5answers
412 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
114 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
68 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
210 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
69 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
143 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
86 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
48 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
77 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 ...
-1
votes
0answers
129 views

how to convert xlsx format data to csv format using perl script

i am trying to convert xlsx format file to csv format file using Perl script. but its not converting to desired format, #!/usr/bin/perl use strict; use warnings; use Spreadsheet::Read; use ...
0
votes
0answers
20 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 ...
1
vote
1answer
35 views

error in build to process builder in java [closed]

I have devloped myself tagger and I want to host on the web. my server is based on jsp. But This tagger is based on svmtool and it has been written in Perl script. That's why, I have created one ...
0
votes
0answers
191 views

Install Ububuntu on Asus X205TA (error)?

I am trying to follow this Instructions to install Ubuntu 14.10 on ASUS EeeBook X205TA , but after running the first line of code, I get this error: Unable to locate package libfont-freetype-perl ...
0
votes
1answer
62 views

How to find and replace a particular string by increasing its numerical part? [duplicate]

My input file is, ami41 ami56 ami23 ami67 ami45 ami34 ami88 jama66 tumi234 bichi23455 susami345 Using a single command line I need the output as, ami42 ami57 ami24 ami68 ami46 ami35 ami89 jama66 ...
0
votes
1answer
81 views

when i am trying to run a perl file i am getting permission denied error

/usr/local/share/lxr/lxr-2.0.3/scripts$ ls ANSI-escape.sh ContextMgr.pm LCLInterpreter.pm QuestionAnswer.pm set-lxr-version.sh VTescape.pm configure-lxr.pl kernel-vars-grab.sh ...
0
votes
0answers
27 views

atftpd pcre problem

I am trying to build ris server using atftpd and samba but the problem is tftp client request files in \path\to\file format and i want to change this to path/to/file format. So i wrote pcre file for ...
11
votes
3answers
380 views

Is there a Perl or Python script I can write which can minimize the Gnome terminal window?

I'm on Ubuntu 14.04 with the old-style GNOME setting from the GDM. (I don't like the new Unity interface.) Is there a way I can create a command that I can type in my terminal window to minimize it? ...
2
votes
1answer
177 views

Running SCP via Perl system() call when running as a service

I created a Debian style service that monitors a database and copies files to a remote machine depending on the data in the database. When this runs "standalone", the entire process works ...
0
votes
1answer
136 views

How do I repair / reconfigure a broken Perl package when apt and dpkg both depend on Perl?

Recent system updates resulted in errors including this: debconf: Perl may be unconfigured (Can't locate Fcntl.pm in @INC (you may need to install the Fcntl module) (for which I submitted bug ...
0
votes
0answers
40 views

Error showing while using check_vmare_api

I am getting error while running check_vmare_api perl command. CHECK_VMWARE_API CRITICAL - Error: Server version unavailable at <'https://1.1.1.1/443/sdk/vimService.wsdl'> i am using ubuntu 14.04 ...
0
votes
0answers
75 views

why i don't receive DHCPDiscover message from server using dongle and why same code give DHCPNac on wifi

I have written a script using perl and i have tested it using two different ways: Using a wifi connection (I have router which is directly connected to server and i am connected to that router). ...
4
votes
2answers
201 views

Remove all English text and leave Arabic text

This question is a lot like this. I just need a slight modification. I have a csv file that looks like this y(document).ready(function($) { $('#wp_mep_2').mediaelementplayer({ m:1 ...
0
votes
1answer
100 views

How do I write perl code for following example? [closed]

I have file content like this: aaa accounting exec ... aaa accounting exec ... aaa accounting commands .. aaa accounting commands .. aaa accounting commands .. aaa accounting commands .. aaa ...
0
votes
1answer
247 views

How to stop cron from sending email when there is nothing in STDOUT or STDERR?

Ubuntu 14.04lts with Perl 5.18.2. This is a special case where Google did not help me. I do not want to turn off email for all cron jobs, I have about 15 jobs in my crontab. I need to see the ...
0
votes
0answers
71 views

Buffer Overflow on pacpl

I have a file in my external HDD called a.mp4.. When I try the command: pacpl -v --bitrate 48 --to mp3 --outdir "/home/user/SoundCloud/output" "/media/user/MyPassport/a.mp4" I get the output/error: ...
1
vote
2answers
120 views

Add Prefix name in a file in Perl Script

I am trying to write a perl script to add the prefix name on the file (~100 files), but i am failed to get it done. Example case that what I means: abc.jpg change to NYear_abc.jpg def.jpg ...