Questions tagged [perl]

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 graphics programming, system administration, network programming, finance, bioinformatics, and other engineering applications.

98 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
359 views

perl: warning: Setting locale failed

I bought a VPS, Centos 7. However, I was able to understand what was going on with SSH and connected to my WHM. After connecting, I get a list of errors and there is something like this: perl: ...
3
votes
1answer
1k views

Modify filenames in Makefile

For reasons that are not important here, I have a source code that I process automatically file-by-file and the processed source files are renamed in a systematic manner. For example, I start out with ...
3
votes
0answers
10k views

Installing custom RPM says “does not update installed package”

I've inherited some servers which have previously always had its software as custom compiled versions (apache, perl, mod_perl etc). I was thinking than rather than compile every time, it may be better ...
2
votes
1answer
68 views

uniq -c Equivalent for Groups of Lines of Arbitrary Count

I've got a file of ~1-2 million lines that I'm trying to reduce down by counting duplicate groups of lines, preserving order. uniq -c works okay : $ perl -E 'say for (("foo") x 4, ("bar") x 4, "baz"...
2
votes
2answers
74 views

Perl script giving different output on bash shell in Linux and /sbin/sh shell on HP unix

Input: tmp# cat test5 1234 012345 0.000 01234 01/02/03 5467 01234 0123 05554567 234 0099 0000 000054 Output on Bash Shell: [tmp]# perl -lpe 's#(^|...
2
votes
1answer
93 views

replacing values in one with the values in another file

I have a csv file named eche in following format: INCON,--,INITIAL,CONDITIONS,FOR*****,ELEMENTS,AT,TIME ,0.315570E+13 VC76,0.10000000E+00,0.2837726135782E+08,0.6756896308414E+02 1K02,0.10000000E+00,0....
2
votes
2answers
486 views

merge multiple files based on first column and save memory issues

I have multiple tab delimited fastq files. I want to match the second line of each read and add up the values next to it if it matches. for example: file1.fq >1 ATGCCGTT file1:1 + HHHHKKKK ...
2
votes
1answer
1k views

SFTP Dual Factor Authentication

My Issue I am trying to automate a file fetch from an external [SFTP] server. The server is using 2-factor authentication. First, it needs a public-private key pairing established [This has already ...
2
votes
1answer
161 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 ...
2
votes
0answers
122 views

Some errors have occured when I installed lucene, a perl module!

Some errors have occured when I installed lucene, a perl module: [xlwang@localhost Lucene-0.18]$ make test Running Mkbootstrap for Lucene () chmod 644 Lucene.bs PERL_DL_NONLAZY=1 /home/xlwang/local/...
2
votes
3answers
3k views

Failed dependencies trying to install package 'libxml2'

I am trying to install libxml2, but my system complains about dependencies. The dependent packages exist on system. The ultimate goal is to install xml_grep2, I have been trying various methods (cpan,...
1
vote
1answer
117 views

Equivalent of “ssh-keyscan -H” in Solaris 10/11

I'm creating a Perl program that adds the specified host in root's known_hosts file. The program works in AIX and Linux, but not in Solaris and sadly, I can't find its equivalent command. Sample line:...
1
vote
2answers
388 views

Change the background color (html format) if a number is less than a threshold

I have the folowing file which is called test.html: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <meta name="generator" content="SQL*Plus ...
1
vote
1answer
635 views

How to remove newline character within a column in a tsv file?

I need "This contains newline" in one row, newline from the column2 and column4 need to remove. nb: For your understanding the data I upload an image if you want I will upload the text content "...
1
vote
2answers
818 views

How to delete a specifc pattern from a string using awk or perl?

How to delete only [gene=xyzI] pattern if I have multiple entries like this: >lcl|NZ_CP018664.1_gene_628 [gene=mscL] [locus_tag=AUO97_RS03160] [location=complement(694895..695326)] I want my ...
1
vote
1answer
675 views

Downgrade Perl Version 5.16.3 on RedHat 7 to 5.10.1

I'm making a migration of my monitoring application from a redhat 6 server to a redhat 7 server. There are perl plugins I have on the redhat 6 server that work. But when migrated to redhat 7, they ...
1
vote
0answers
48 views

how to warn about user quotas of ftp user in a /sbin/nologin shell?

how would i do a check through a perl script or bash script remotely and throw a warning if the ftp upload size beyond the limits specified for that user. only ftp login is allowed for the remote ftp ...
1
vote
0answers
914 views

How do I fix this broken CPAN and Perl installation

My Perl and cpan installation is broken. The perl version is shown below and this command executes and runs fine. >perl -v This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-...
1
vote
1answer
57 views

perl - search for a long line and change a word in it

One line bash command: how to search for a long line and change a word in it? perl -i -0pe 's/my long line/my right line/g' file That works, but can I have some thing more readable such as perl -i ...
1
vote
1answer
54 views

How to match string with regexp and conditionally do stuff with capture groups

The idea here is to change remotes from http to ssh in all git repositories find / -type d -name '.git' 2>/dev/null | xargs -I {} $SHELL -c \ 'cd $(dirname {}) && echo $(pwd) > /tmp/log....
1
vote
1answer
99 views

Building dynamically driven web sites with Mason (Perl) with httpd on OpenBSD current

Is it possible to build dynamically driven web sites with Mason (Perl) with httpd on OpenBSD current? See The Mason Book and the introduction to OpenBSD's httpd.
1
vote
1answer
119 views

Unix Solaris script for executing commands in multiple remote hosts

I have two hosts for eg. 1) 00.00.00.01 having regions on diffrent ports for eg. a) a1region (port 0011) b) b1region (port 0012) c) c1region (port 0013) 2) 00.00.00.02 having regions on diffrent ...
1
vote
0answers
104 views

Can't listen on ephemeral tcp port

I have several servers running CentOS 7.2, all installed from a local repo and managed via puppet (so they're very similar). On most of them, running the following command produces no output (as ...
1
vote
1answer
46 views

timestamping history file causing erroneous lines in history command

I have .bash_profile setup to export to a history file: export HISTFILE=/root/history/.bash_hist-$(who -m | awk '{print $1}') Then I am exporting time stamps for the history command. export ...
1
vote
1answer
367 views

How to Load data to one table from Multiple excel files?

I have to load data from multiple excel file into one table , Please help me to achieve the solution. We are getting excel file from different retail shop which contain multiple column , each file is ...
1
vote
1answer
65 views

IRSSI notifier - by pulling method

Is there an option in irssi to get state about new unread private and public messages by external application. If there is such option, i could periodically read that info from my bash script and do ...
1
vote
0answers
897 views

Perl script to delete big directory

This blog gives different ways of deleting Big Directories and their relative times for deleting a directory with 500,000 files. The script using perl is reported to be fastest, which is given by cd ...
1
vote
3answers
37 views

Perl script in bin that inserts 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 ...
1
vote
0answers
670 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 ...
1
vote
1answer
588 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
1answer
674 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) ...
1
vote
0answers
919 views

zip command is failing during high memory usage

We have several perl scripts, which generates and emails reports. The script that emails the files expects a .zip extension. The report scripts generates a .txt or .xls file and then runs the ...
1
vote
1answer
105 views

Better approach to generating and adding contents to files

I have an input file like below. 1 First one 2 First two 3 First three 3 Second three I am generating 2 output files like below. #FILE1 1 First one 2 First two 3 First three #FILE2 1 ...
1
vote
1answer
321 views

How to safely move a file to another directory and remove duplicates

I want to move files from Downloads, Documents, Pictures, Music, et al to shared locations. This is for various reasons, including because I want to keep media in a central, shared place. I want to ...
1
vote
1answer
536 views

Why wouldn't Perl CGI script run

I'm using Apache on CentOS and am trying to run a Perl CGI script as directory index so it will run automatically as a subdomain. I added DirectoryIndex script.cgi and added a Directory stanza noting ...
1
vote
1answer
204 views

How do I reinstall the bioperl modules on Ubuntu?

I am trying to learn bioinformatics the hard way. I have no background in Linux, Ubuntu, bash, Perl, Python, etc. I'm trying to use several programs, mostly the bioperl modules, that have been ...
1
vote
3answers
104 views

Perl: Inserting at nth position in file

I have content in my file : 123456789 My output is: 1234CC789 Desired Output is: 1234CC56789 I am insert PP at nth position suppose. But when I am inserting any text it is inserting the text at ...
1
vote
1answer
338 views

Error when compiling XML-Parser-2.44 with Perl

When trying to perl Makefile.pl XML-Parser-2.44 while chrooted in LFS, I get this error: Checking if your kit is complete... Looks good Warning: prerequisite LWP::UserAgent 0 not found. Have /tools/...
1
vote
1answer
807 views

Execution Errors after perl update on arch linux

I updated perl to "perl-5.26.0-1-x86_64" through "pacman -Syu" which is what I suspect to be the cause of the execution errors that I now encounter: When trying to start vim: if_perl.c: loadable ...
1
vote
2answers
289 views

How to extract specific pattern from a file in HP-UX

I would to like extract the pattern "/oracle" from a file. I tried with "grep -w" command but it returned all the lines which have oracle word. I need to extract only /oracle. Please tell me if any ...
0
votes
0answers
14 views

Getting error while running the shell script

CURRTIME=$(perl -e ' print time(), "\n"') FILETIME=$(cat timestamp.txt ) TIMEDIFF=$(($CURRTIME - $FILETIME)) I need to add 1 second to FILETIME variable, even if there is no entry in timestamp.txt, ...
0
votes
0answers
25 views

pssh + verify date between machines and alert if date difference is more then 3 second

we are using the following great pssh command in order to see if time differences is more then 3 second between machines pssh -i -o /tmp/out/ -e /tmp/err/ -H "master01 master02 master03 worker01 ...
0
votes
1answer
36 views

File read, compare and replace based on comparison in text file

Hi i need guidence to write code for file processing. i have one file which having ~ as delimeter and each line is keyword is 1st column. First i have to find the lines which matches with ^6999 Then ...
0
votes
2answers
84 views

How to randomly change the order of two columns simultaneously for 1000 times using simulation values?

I have a data looks like this: ID pheno 231 0.12 432 0.32 11 0.0003 134 0.33 2334 0.553 12 0.33 100 0.331 1008 ...
0
votes
0answers
25 views

Bash-Perl Make Substitution and Return array (string & number of replacements/substitutions)

I have this code that makes substitutions in a file segment. The code should be left mostly unharmed except for this problem. I need to return back to bash, the number of replacements made by perl ...
0
votes
0answers
17 views

How to create RPM for generic Perl module

I have a generic Perl module that will run on any release of Perl 5. I need to create an RPM for it that will install it into the vendor_perl subdirectory. I don't want to create different RPMs for ...
0
votes
0answers
29 views

Why the distr instmodsh cannot list the installed distr/vendor_perl modules ?

We find such a phenomenon with the instmodsh, that is, it can only list the installed CPAN modules ?! So why it cannot list the installed distr/vendor_perl modules though itself belongs to a distr ...
0
votes
1answer
43 views

Replace group of similar text in string from nth position with one string else increment the value by +1

I have a text file with following lines for example. Input DD0TRANSID000019021210504250003379433005533665506656000008587201902070168304000.0AK 0000L00000.00 N ...
0
votes
0answers
12 views

Log4perl Fails on Linux Lite

I recently re-purposed an old laptop of mine by popping in a new SSD and installing the latest stable version of Linux Lite. I've been trying to get my preferred configuration of Atom running on it. ...
0
votes
0answers
84 views

Compare two log files line by line and print difference

I have to compare two different log files line by line (in each line data between two symbols (: and ;) is to be checked) and print all lines of log 1 that are not in log 2. If two or more lines have ...