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

2
votes
6answers
165 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
0answers
21 views

I Need execute a awk sentence on windows server [on hold]

I Need execute a awk sentence on Windows Server, this sentence, read a file.txt, field takes column 4, and prints, I need run this sentence. thanks. Sentence:awk '/"Box11"/ { print $0 }' test.txt|awk ...
2
votes
1answer
32 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?
-1
votes
0answers
31 views

Convert perl to shell/bash [closed]

I understand C and C++ and new to perl scripting. I must convert the perl script under the following url to shell or bash: ...
0
votes
0answers
17 views

How to avoid going to next line in perl script..? [closed]

In the following perl script, results give an un-necessary next-line operation. How to avoid this? $date = date >> /home/user/Desktop/PERL/TEST_FILES/hdd_ram_logs.txt; @matches ...
1
vote
0answers
25 views

Apache 2.4 and mod_perl 2 on Ubuntu 14: 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 ...
-1
votes
0answers
21 views

How to display the 'percentage free' RAM usage using Perl Script? [duplicate]

I need to make a perl script which will display the percentage free RAM usage and the value should be able to be piped to another command. Appending into a text file should also be possible within the ...
0
votes
1answer
42 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
28 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
47 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
118 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
37 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
47 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
65 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
34 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
33 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
506 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
370 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
70 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
46 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
81 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
44 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
82 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
78 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
34 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
59 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
42 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
17 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 ...
0
votes
0answers
17 views

error in build to process builder in java

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
170 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
55 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
44 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
26 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
368 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
120 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
116 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
31 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
62 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
164 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
90 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
186 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
53 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
1answer
95 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 ...
0
votes
0answers
16 views

Bioperl percentage bar

I have the next perl script that convert fastq file to fasta file, and make a count of the sequences in the fasta file; I would like to add a percentage of advanced like a percentage bar or printing ...
3
votes
1answer
330 views

Perl may be unconfigured?

Hi I have error when I want to install,remove or configure my package this is the error debconf: Perl may be unconfigured (Can't locate Debconf/Log.pm in @INC (you may need to install the ...
0
votes
0answers
14 views

Run perl script from cgiperl

I am new to cgi per. I have perl script actually works. I like execute my perl script from cgiperl and print the out in web page. Any help? 1) take a text file as inout from webpage and put it in a ...
0
votes
0answers
38 views

Errors in Simple.pm when using debmirror

Hi since the update to utopic debmirror does not work any more due to errors in LockFile/Simple.pm. The error is: Use of uninitialized value $stamp in chop at /usr/share/perl5/LockFile/Simple.pm line ...
-1
votes
1answer
270 views

Resolve error while installation!

i am getting the following error while installing anyhthing: installArchives() failed: perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = ...
1
vote
4answers
123 views

search for duplicate photos

I have photos, in folder A, they also exist, in folders B and C. They have the same filenames. How to search for them and delete them from folder A? A perl script or something would be ideal since I ...