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

2
votes
1answer
18 views

nix package manager: perl warning: Setting locale failed

Whenever I run a command for the nix package manager (e.g. nix-channel --update) I get the following warning: perl: warning: Setting locale failed. perl: warning: Please check that your locale ...
3
votes
0answers
54 views

Transpose a file, and replace missing values by

Please guide with the following data formatting. I have Readings for Names, from Machines and sometimes these readings are replicated. Where a reading was not found, it is left as blank. Name ...
-1
votes
0answers
43 views

replace first string before first space [on hold]

how to replace first string before first space? NC_009925.1_13653 [754389 - 754574] Acaryochloris marina ATTCCTGATTCTCTTGATGAAAGTAACATTATGGATCAT... TATGATCCATTCAGGCATGATGCAAGGCGCTACCCCCAA... 110311 ...
-1
votes
0answers
23 views

target a specific part of code and change it

I have the following html code <td style="color:#8C8C8C;font-size:10px;font-family:Arial,'Helvetica';text-align:center; padding:0 15px 0 15px;">Keep ensured your hat is fine.<br /> If ...
1
vote
1answer
16 views

Rename command with non-existing target directory

I'm trying to group files automatically into subdirectories using a command like this: $ rename 's/(.)(.)(.+)/$1\/$2\/$1$2$3/' *.* A dry run with the -n parameter shows me what I want: test.jpg ...
0
votes
1answer
23 views

how to change several piece of html code

I have several chunks of html code ,see below, in a html page that I need to change Assurez-vous de bien recevoir tous nos messages en ajoutant bebeco@concretisezvosprojets.com à votre carnet ...
2
votes
2answers
41 views

How do I extract the content of quoted strings from a file

have a file which looks like this: anm="12S123S" family="" type="Std" product="" name="nand" allow="yes" anm="12321 S=" family="" type="Std" product="" name="dan" need="No" anm="SWED" family="" ...
0
votes
0answers
14 views

how to remove the curly braces and string from json file in perl [migrated]

{ "ticket": { { "id":"01", "language": "Java", "edition": "third", "author": "Herbert Schildt" }, { "id":"07", "language": "C++", ...
0
votes
2answers
28 views

How to insert a variable in a variable in a random place?

Q: How can I insert variable $b to a truly random place in variable $a? Example INPUT variable content: $ echo $a árvíztűrő tükörfúrógép $ echo $b ZZ OUTPUT $ ./somemagicscript.sh árvíztűrő ...
3
votes
2answers
42 views

How to “grep” for line length in a given range?

I need to get only the lines from a textfile (a wordlist, separated with newline) that has a length range of minimum or equal than 3 characters, but not longer or equal then 10. Example: INPUT: ...
2
votes
1answer
48 views

how can I add an extra character after a word search [closed]

I have the following field names demelog voyapro naisjdf naismc decoide decoccm travide travccm equiccm mariccm Below is a sample of my file. There are more columns before the first fck=83... ...
-1
votes
0answers
27 views

I want to write a perl function (sub) called “comma” that takes a string as input, splits the string into an array [migrated]

I want to write a perl function (sub) called "comma" that takes a string as input, splits the string into an array based on commas (ignoring white space around the comma), and returns an array of ...
4
votes
3answers
190 views

Can tr commands be chained to avoid multiple tr processes in a pipeline?

I have a bunch of txt files, I'd like to output them lower-cased, only alphabetic and one word-per line, I can do it with several tr commands in a pipeline like this: tr -d '[:punct:]' ...
0
votes
0answers
21 views

How to convert structure information in a Stockholm into another format?

I need to convert this: hg19_11_6_Ala ...
0
votes
0answers
25 views

How to highlight given string in given place?

How can we modify this: <a href="http://foo.bar1">asfdlksafbar1qsasadf</a><br> <a href="http://foo.bar2">svasfbar2saldkfj</a><br> <a ...
0
votes
2answers
61 views

Help to read a flat file into unix and output to simplified csv like format for import into excel

I have a text file that has data written to it in the format below, its thousands of rows. The new record always begins with WHATEVER.RDNDISPLAY or WHATEVER.DSPLY_NAME. The name of the record is ...
0
votes
0answers
14 views

How to assign variable value to constant in perl? [migrated]

I have following code #!/usr/bin/perl -w use warnings; use constant ARRAY => "XCC320G"; print ARRAY; print "Enter ur choice\n"; chomp($choice = <STDIN>); ARRAY=>$choice; print ARRAY; ...
2
votes
3answers
87 views

Replace multiline string in files

I have a number of files I want to update by replacing one multi-line string with another multi-line string. Something along the lines of: * Some text, * something else * another thing And I want ...
0
votes
1answer
69 views

lwp-request Fails After Upgrade to Centos 7

I have a bash script that runs well on centos 6, which has an lwp-request in it. I upgraded my system to Centos 7, and the request fails to run: # lwp-request -E https://localhost/admin/startup GET ...
1
vote
1answer
41 views

How can I use regex to extract the text following two conditions into a variable?

I'd like to extract a setting for a given host in the ssh_config file and put it into a variable. Host mysite HostName 123.1.1.1 User myuser Port 13245 GSSAPIAuthentication no ...
1
vote
0answers
15 views

Make a rpm package from the cpan compatible tree?

I always make my perl module following the CPAN-complient tree. I would like to use this tree to create a rpm file I could install on a hundreth servers. Is it possible to make a rpm package with ...
0
votes
2answers
39 views

occurance of a string in multiple file

I have two files 1. input.txt 2. keyword.txt input.txt has contents like .src_ref 0 "call.s" 24 first 0x000000 0x5a80 0x0060 BRA.l 0x60 .src_ref 0 "call.s" 30 first 0x000002 ...
0
votes
1answer
41 views

What “bad list v: No such file or directory at -/usr/libdata/per15/OpenBSD/Pkg_Add.pm line 1115” means?

I recently installed OpenBSD on an old laptop from 2005 and I am trying to install nano and then xfce4 and then a few other programs, but every time I try to use pkg_add, I get the message: Fatal ...
1
vote
2answers
36 views

Ack regex on filenames

According to this thread: Q: My understanding is that ack uses Perl-derivative regular expressions, is that correct? A: Yes. In fact, ack is written in Perl and just forwards the expressions ...
0
votes
1answer
25 views

amavisd: Unrecognized character \xBB;

I have a problem to start the amavisd. When I try to start with /etc/init.d/amavis start I get the following error: Starting amavisd: Problem in Amavis::DKIM code: Unrecognized character \xBB; marked ...
3
votes
1answer
40 views

Filter out inconsistent data blocks

I would like to filter out rows that has inconsistent geno values in line-part blocks. In case of duplicate consistent values , I would just keep the first row. As example, 'gf345 part1' has more ...
2
votes
1answer
36 views

How to upgrade File::Path on my Mac OS X as a non-root user

My mac machine is quite old (Mac OS X 10.6.8) and I have a question on how to upgrade a perl module File::Path. I mostly compile my LaTeX document using latexmk which is basically a perl script. It ...
1
vote
3answers
102 views

Cannot run Perl code as CGI script

I am using Arch Linux with httpd web server and webpage works ok. I had to add "Reboot" button on webpage and now I want to run a Perl CGI script, reboot.cgi, which so far only contains "Hello world" ...
0
votes
0answers
28 views

error for installing Math module CDF in perl

I am trying to install Math::CDF in perl I tried both cpan -i Math::CDP and install from downloaded files both end up in error after enter make install: Running make install make[1]: Nothing to be ...
-1
votes
1answer
51 views

perl env path in .bashrc

I am running Manjaro Linux and perl 5.20.1, which came pre-installed. I have started learning perl and need to get it in my path in ~/.bashrc. (Manjaro uses .bashrc and not .bash_profile). I should ...
0
votes
0answers
17 views

capture tmux screen and process with shell command

is there a way to capture text currently on the screen of a tmux session and pipe it into a shell command then display the output? I was hoping to use something like this with Oracles sqlplus to do ...
3
votes
4answers
161 views

pattern match and capturing in unix

I have a file like this: A1-1915435_1_MIMAT0000069_MirBase_miR-16_microRNA_1_22-A1-1915435_1_ENSG00000206737_ENST00000384010_U1_snRNA_73_115 ...
1
vote
1answer
41 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){ ...
2
votes
1answer
70 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
80 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 ...
0
votes
1answer
19 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
27 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
72 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
33 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
121 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
107 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) ...
2
votes
0answers
48 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
248 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
83 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
146 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
263 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
95 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
472 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
17 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
64 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 ...