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

0
votes
1answer
14 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 ...
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 ...
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
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 ...
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
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.
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 ...
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 ...
-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
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 ...
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 ...
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 ...
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\$")' ...
-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
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 ...
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 ...
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 ...
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; ...
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, ...
-3
votes
2answers
33 views

upload images in tomcat server [closed]

I am facing image upload issue in tomcat server outside the war file. My image location is /home/username/tomcat-images.and what is the url of to access images in web browser.
3
votes
3answers
122 views

Undo letterspacing with sed

I have a source text file containing text where some words are l e t t e r s p a c e d like the word "letterspaced" in this question (i.e., there is a space character between the letters of the word. ...
-2
votes
1answer
65 views

linux shell command in Perl program

Hi friends here is some issue I want to write a script that restarts server which is in stopped status. Here I am using my MySQL server in future if it is in stopped status then it will be restarted ...
2
votes
2answers
56 views

Truncate the third column until given strings

INPUT: W41784094 CH60104475 lasbalsrbla bla foo bar bla PT~CH60104475 W41788464 WO60444453 hellobla bla -bla foo bar 432 alaf. PT~CH60107925 W41753387 IN61026681 sim##bla-bla bla foo bar ...
0
votes
1answer
53 views

Python output in XML format

I have a python script which compare IP list with IP Database and gives output of matching criteria. (I got the script from this forum). convert.py #!/usr/bin/python import socket,struct ...
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 ...
1
vote
1answer
82 views

Impute data by majority value per group

I have instruments in col1, their variables in col2 and calls in col3. In this example, there are 17 INS and 3 M types. Potentially there will be 17 x 3 rows. But some are missing. INS1 M1 AA ...
3
votes
5answers
152 views

How to add column in the beginning of file using perl?

I want a Perl one-liner that checks whether the first fields of an input file is the file's name and, if it isn't, adds the file name as the first column on every line. Example written in shell : ...
0
votes
1answer
40 views

How remove duplicates in same file and with if condition?

INPUT FILE: has all these values without header: customer ID, code, start_date, end_date 124343, DCW, 2015-07-06, 2016-08-03 235432, ABC, 2015-04-26, NULL 235432, ABC, ...
1
vote
1answer
23 views

calculate numbers on end and merge to one line

So in a file i have lines like these: thisdata:thisother:1337 thisdata:thisother:1800 thisdata:thisother:1500 thisdata:thisother:46984 I would like to output: thisdata:thisother:51621 for all ...
-1
votes
1answer
19 views

Matching 2 different files by first column

So I have 2 different files. file1.txt is: abcdefjeiireiiioe:data:otherdata rijirjeiwrieeoooe:datamore:otherdatamore file2.txt is: abcdefjeiireiiioe:data:otherotherdata ...
6
votes
1answer
115 views

How can I extract/change lines in a text file whose data are separated into fields?

How can I manipulate field-based data from the commandline? For example How can I print only lines whose Nth field is foo? How can I print only lines whose Nth field isn't foo? How can I print only ...
0
votes
2answers
70 views

Installing perl modules

I was trying to install a perl module Future::Utils on my Ubuntu machine but didn't find the exact command. I tried this command but it didn't work: sudo apt-get install libfuture-utils-perl I have ...
0
votes
2answers
64 views

Find all characters “[1-777])” at the beginning of the line

Pseudocommand perl -pe 'g/^[1-777])/g' data.txt where I try to all numbers at the beginning of a line with ")" following them etc 1), 67) and 777). Data where all question numbers should (etc 1), ...
-1
votes
2answers
65 views

To have strict and warnings in Perl oneliner [closed]

I really miss use strict; use warnings in my Perl one-liners such as: perl -ne 'print unless /[0-5],[0-5]?|hernia|.{170,}|benz/' file` especially when I include many conditions separated by |. I ...
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. ...
0
votes
1answer
31 views

Filter out combination options in lines

Data Life by cerebral flow is coming to:---1) Prolonged jumping rate---2) Small holiday course---3) Hello this world---4) Dance rock coffee---5) Therapy unproven---Choose right ...
1
vote
1answer
28 views

source file with keys and values and use it in perl code

I have a file like this saved as /var/ldt/ldt.conf : LDT_HWADDR='00:00:00:00:00:00' LDT_DISK='/dev/sda' LDT_OS_ID='24' LDT_VERBOSE=true RUN_UPDATES=true I want to source it in a way that in my perl ...
1
vote
2answers
55 views

shell or perl script to check group have read privileges

ls -l drwx------ 8 ws web 1024 Apr 29 2013 abc drwxr-xr-x 8 ws web 1024 Oct 19 2011 def I need some script to find directories like abc which doesn't have read/execute permissions ...