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
0answers
19 views

file name as argument and sort in descending way in perl?

I have this perl script #!/usr/bin/perl use strict; open my $df, '<', 'file.txt' or die "open: $!\n"; my %h; while (<$df>) { $h{$_}++ for split /\s+/; END{ for (keys %h){ ...
-1
votes
0answers
10 views

mrtg error: ' $target->[2]{$mode} ' evaluated to 'NaN' instead of a number [on hold]

[root@2222]# mrtg start this error appears ERROR: Mrtg will most likely not work properly when the environment variable LANG is set to UTF-8. Please run mrtg in an environment where ...
2
votes
1answer
42 views

How to count the number of occurrences of a number larger than x, from every column?

I'm trying to figure out how to count the number of occurrences of values that are greater than some number (i.e. 0.1) in each column and then print that value out for each column. Here would be some ...
1
vote
1answer
65 views

Alias for perl script

So far while surfing web I've discovered nice addition to my gpg password generator and I've decided to adjust my alias with these commands. Here is the code gpg --gen-random 1 20 | perl -ne'print ...
1
vote
0answers
17 views

Search for the multiple string and print it to file in order [migrated]

I have a data as below, and I need to filter out the Author with "file changes and Lines Modified/Added Lines Deleted" And I need to separately print it to file with respect to Authors. If there are ...
0
votes
1answer
12 views

Input data to mech-dump via STDIN?

While a: mech-dump foo.html perfectly works, a: FILE="$(cat foo.html)" echo "$FILE" | mech-dump Must specify a URL or file to check. See --help for details. doesn't. How can I put the input ...
0
votes
0answers
16 views

Unable to access bugzilla url

Actually I installed bugzilla in one vm. It is using mod_perl and Email configured. Everything working fine. In browser i access the url http://MY_server_IP/bugzilla working fine. In another vm, I ...
4
votes
1answer
69 views

Insert missing data within blocks

I`m a biologist and I am trying to solve this problem, please guide me on where to start. I do not know which forum to post this in, please let me know if this place is not appropriate. I have blocks ...
0
votes
0answers
11 views

Can't locate Cairo.pm in @INC

I am running prinseq for trimming my data but got this error: Can't locate Cairo.pm in @INC (@INC contains: /home/A/software/vcftools_0.1.11/perl How do I install this?
1
vote
7answers
104 views

repeat a line, splitting one field

I have a tab delimited file in which in every line I have this: K00001;K00004;K00008 0 0 34 0 0 0 0 0 0 0 0 0 0 0 0 0 36 0 0 52 0 0 0 6 0 I would ...
1
vote
1answer
37 views

Assp won't start

I tried to install ASSP (Anti-Spam SMTP Proxy Server),but when I try to start it I get the following: $ perl assp.pl Perl version 5.012003 (5.12.3) is at least recommended to run ASSP 2.4.3 (14313) ...
0
votes
0answers
7 views

How can I get a Perl script to read input from both STDIN and command line arguments? [migrated]

Inspired by this U&L Q&A titled: "Back to back Pipes into a Command". How could one parse both input via STDIN and via command line arguments to a Perl script?
2
votes
0answers
23 views

Perl failed set locale on AIX 7.1

After setting user language to Chinese with GB18030 encoding in SMIT, following env variable was added in user's .profile: LANG=Zh_CN LC_MESSAGE=%l.%c ...
12
votes
2answers
204 views

Security implications of running perl -ne '…' *

Apparently, running: perl -n -e 'some perl code' * Or find . ... -exec perl -n -e '...' {} + (same with -p instead of -n) Or perl -e 'some code using <>' * often found in one-liners ...
3
votes
2answers
45 views

Coloring tail output with perl

tail -f logfile.log | perl -pe 's/.*foo*/\e[1;41m$&\e[0m/g' will color all the lines containing the pattern "foo" in the logfile.log file. How can I make use of this in order to highlight ...
1
vote
1answer
45 views

Missing shell module in perl 5.18

I'm running Perl script under SLES 12 which has Perl 5.18 installed. When trying to run my Perl script I get an error: Can't locate Shell.pm in @INC (you may need to install the Shell module) (@INC ...
2
votes
3answers
91 views

How to open terminal, split to 9 terminals and switch between them using one script?

I would like to open a terminal, split it to lets say 9 parts (3x3) and execute some bash script. But for each terminal part different script. Can this be done using perl, python or even bash? How ...
0
votes
3answers
46 views

How can I convert timestamps in a column to a date?

I have a file containing this: 1415602803,LOGIN SUCCESS,AUTH,user2,192.168.203.63,10.146.124.73,59996,22 1415602807,LOGIN SUCCESS,AUTH,user1,172.24.31.10,172.32.1.1,48191,22 1415602811,LOGIN ...
0
votes
1answer
139 views

How to convert XML file to CSV using Perl?

I'm looking for some suggestion to convert the .asn1 (CDR Data) to CSV to load to tables. As per current approach I'm using informatica B2B parser to parse the ASN file to XML than using XSD loading ...
0
votes
0answers
12 views

Building debian package of Perl module with Module::Build and pbuilder

I have a Perl module that I package for Debian using pbuilder. The module has a Makefile.PL. The debian/rules file is very simple: #!/usr/bin/make -f PACKAGE := $(shell dh_listpackages) %: ...
3
votes
1answer
37 views

What is Debian equivalent of RPM package perl-ExtUtils-Embed?

I need to install some SW on Debian. This SW requires perl-ExtUtils-Embed in a installation guide made for RedHat based systems (CentOS in my case). What should I install on Debian to get all what is ...
1
vote
1answer
38 views

perl rename: Prepending something to a set of file names across subdirectories

Although perl's rename tool has become an invaluable companion for my daily work, there are still some quirks that make work more difficult - especially when files are not in current work directory. ...
1
vote
0answers
43 views

Neutralisation of data from Windows to Unix

I just noticed that other platforms files (Windows) had to cause me many bugs, like here, in my regexes. Mostly, the line ending ^M. There seems to be many ways to do dos2unix, like here described. ...
0
votes
0answers
16 views

To visualise look-behind in this Regex

I am using Regexr to visualise my regexes now. I need look-behind but Javascript does not support it, example code here. The project code base seems to be dependent Javascript (NodeJS) in Github. I ...
0
votes
2answers
53 views

Grouping data and assigning alphabet and numeric values for new categories

I have 4 columns in my tab delimited data, I need to perform 2 steps. Group the data according to combinations of first 2 columns. Every time a new combination of values appear in the concatenated ...
-1
votes
3answers
83 views

Find files less than 1 week old with match TODO in files

My unsuccessful proposal find ./ -newerct '1 week ago' -print | grep TODO No output although should be. Files are text files like Lorem % TODO check this out Lorem ipsun How can you find less ...
0
votes
1answer
85 views

How to update files based on another file

I have 4 csv files and I want to update set of three based on values in the other one. The first 2 files (file_1 and file_2) contains names and their numerical ids. The third file (file_3) contains ...
1
vote
4answers
183 views

How to convert fixed length fields in a file to space delimited

I have a fixed length matrix type file where each field is 20 characters long. How can I convert this to a space delimited file? Also there are some missing values, which I would like to ...
0
votes
1answer
48 views

Perl/awk/bash: multiply and sum values putting values inline instead original text [closed]

I have a text like this: ;--------------------------------------- JOURNEY_ARRAY_01 .BYTE <JOURNEY_00 .BYTE <JOURNEY_01 ;--------------------------------------- JOURNEY_ARRAY_03 ...
1
vote
3answers
73 views

multiline editing using perl or any other tool

I'm editing my .uncrustify.cfg file to make it more readable. I just want to reformat like this: Two lines in: # Add or remove between the parens in the function type: 'void (*x)(...)' ...
1
vote
2answers
122 views

Group words based on the value of the first column

I want to group all the file contents based on the value of first column. It would be better if the output is in sorted form. Input: 1 foo 2 bar 1 foobar 2 barbar 3 apple 4 banana 3 mango 5 orange ...
1
vote
4answers
163 views

Sed/awk/perl: reversing order of comma separated values, preserving other text

I have this text: LABEL1 .BYTE 01, 02, 03, 04, 05 .BYTE 01, 02, 03 I need to reverse only comma separated values order: LABEL1 .BYTE 05, 04, 03, 02, 01 .BYTE 03, 02, 01 I need ...
2
votes
1answer
64 views

Replace new line character between two strings

I have problem and see your answer in one of questions suiting with one exception Here is what i am trying to achieve \n (new line character) has to be replaced with blank when \n is between two \" ...
0
votes
1answer
36 views

OSD notification for Irssi

I want to get a notification each time I get a /query message or get highlighted in a channel. this notification should be in the form of bubble OSD (on screen Display). If OSD isn't possible for ...
1
vote
1answer
55 views

count matches and mismatches group by

Please help with a shell script of the following. I need count number of consistent variables in each lane (col1) across samples (col2). For example, since all the values (col4) of lane1 variable 1 ...
2
votes
2answers
54 views

Sed/awk/perl: modify text preserving parts and align to a column

I have a text like this: A1JOURNEY0TO1 .BYTE 00, 00, 00 A2JOURNEY0TO2 .BYTE 00, 01, 00 A3JOURNEY1TO0 .BYTE 00, 01, 01 I need to have: JOURNEY_01 ; 00 TO ...
1
vote
1answer
102 views

Perl plugins don't work on my rxvt-unicode! [closed]

I wanted to add some features to my urxvt so I changed my .Xresources file. for the global effect of plugins I copied them all to /usr/lib/urxvt/perl. but still no multi tab, clickable link or ...
-1
votes
2answers
51 views

How to remove only 0-9 character long numbers from a file?

How can we remove only the numbers that are 0,1,2,3,4,5,6,7,8,9 character long from a file? I mean the lines that are matching this pattern. Example for removable lines: cat input.txt 1 123423113 ...
0
votes
1answer
79 views

Cut a specific part of a column from a csv file [closed]

I have to process a csv containing about 15 columns one of which contains a particular timestamp that includes milliseconds. When I go to insert this csv into a DB, I get an error because of this ...
1
vote
0answers
70 views

How can I send email without using uuencode and mute?

Is it possible to send attachment from unix/AiX without using uuencode and MUTE command? We can write a Perl script which will send email properly but without attachment, can I get the perl code ...
1
vote
1answer
52 views

How to write this replacement with condition

I want to replace now within my working directories the word -> with $\to$ if the word is not within verbatim environment. Pseudocode Replace all entriens of -> with $\to$ everywhere else but not ...
1
vote
1answer
107 views

Regex works in shell but not through Perl script

I'm having trouble executing a Perl script through the Unix shell using Perl's system command. I've had more complex regex commands I had to adjust accordingly to convert from Unix to Perl, and ...
3
votes
2answers
135 views

How to write this pseudocode where condition

This question is extension of this question about listing questions of directories. I get a problem that I need to understand the original section of the text. Current output where you see the ...
0
votes
2answers
49 views

To match only innermost environment by Regex

I want to match the innermost environment of begin{question} and its corresponding end{question}. Example data \section{Takayasu arteritis} \begin{question} {You get a patient. What do you notice ...
2
votes
1answer
135 views

grep search expression and rename file

I have readable pdf files that all contain the string VAX followed by eight numbers, like VAX00002885. Now I want to find that expression and rename the corresponding pdf to VAX00002885.pdf (in this ...
1
vote
1answer
47 views

Perl one-liner for replacing values greater than a threshhold

I have a text file which contains 7 columns of floating point values (). I would like to use perl one-liner and find the values which are greater than a threshold in the 7th column. Then, I want to ...
-2
votes
1answer
3k 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
5answers
183 views

df -k + how to match the root volume line

please advise how to match the "/" volume from df -k command? I tried the following: [root@machine /]# df -k | grep "/" /dev/vx/dsk/bootdg/rootvol 130926685 71378710 58238709 56% / /devices ...
3
votes
2answers
1k views

echo test | stty -echo -> stty: standard input: Inappropriate ioctl for device

I was playing with a perl script that takes user input with the following: system( qw( stty -echo ) ); $? == 0 or die "Error unable to disable character printing.\n"; print "$prompt: "; my $input = ...
2
votes
1answer
70 views

Why does mysql server packages have perl dependencies in linux distros?

I'm trying to clean out some unneeded packages from one of my gentoo boxes with emerge --depclean, and I thought I had a few perl modules installed that none of my wanted packages should require. So, ...