# perl

Tags: perl
• ## Need to parse utf8 email with perl2017-09-16

I need to parse an email that appears to be encoded using utf-8 to pull out the subject and sender and pieces of the body. The header parts are no problem, but the body looks like this: LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t

Tags: email, perl, utf 8, mime, mime types

• ## perl list path of subdirectory using File::Find2016-07-27

How can I get all the paths of a subdirectory foo into an array in perl using File::Find abc\def\sdfg\gthrth\foo\ abc\def\fgfdg\foo\ abc\def\sdfgdsg\fgdfg\gfdgf\tytty\foo\ abc\def\foo\ I want to get the full paths of all subdirectories foo inside dir

Tags: perl, file find
• ## Perl reading from file into hash2016-03-19

I would like to read the contents of a file into a hash structure. The header of the file should be the key in the hash structure, as well as the values being the content listed below each column. The file that I am going to read from will look somet

Tags: perl, hash
• ## removing trailing words end with : from a string using perl2016-01-10

i have question on how to remove specific set of words that end with : in a string using perl. For instance, lunch_at_home: start at 1pm. I want to get only "start at 1 pm"after discarding "lunch_at_home:" note that lunch_at_home is ju

Tags: perl

This question already has an answer here: Why is 'print (52-80)*42' different than 'print 42*(52-80)' in Perl? 3 answers Recently I came across a statement like this print +( map { $_ + 1 } @$_ ), "\n" for @$array; # <- AoA I had not seen the Tags: perl • ## cvs annotate and standard error redirection2015-03-13 First, some background. I'm trying to use cvs annotate within a Perl script invoked from a ksh command line to find out who's using bad hex constants in their source code and dole out justice appropriately. I'd like to use stdout for this program str Tags: cvs, perl, ksh, stderr • ## Why I cannot read file line by line in perl script? 2015-03-10 I have a perl script, which has to read a file line by line. line in the file: 0060|9592014|A001-9592014-0060|82769|NOVARTIS PHARMA SERVICES AG BASEL|51671|NOVARTIS AG|A+|SWITZERLAND|Guarantees Issued|12/31/2016|12/31/2016|0|0|0|0|0|0|0|0|0|29014.096 Tags: perl • ## How to load a bunch of perl modules into a perl script2015-02-25 This is what I wish to do: In every script I make/develop I always call perl libraries and sub routines like: #! /directory/bin/perl system('source /directory/.cshrc&'); use Net::Domain qw(hostname hostfqdn hostdomain); use Time::Local; use Time: Tags: perl • ## Perl Module Net::DNS - calling "tsig" method on resolver object results in error2015-02-16 recently the linux-distribution i use (recent gentoo) upgraded the net-dns package to version 0.74 (from 0.66). from this time using TSIG on queries and updates does not work anymore. former i used:$resolver = Net::DNS::Resolver->new(...); $resol Tags: perl, dns, perl module, gentoo • ## How to use Perl to copy files from ssh server?2015-02-11 My requirement is find for specific files (filename.tup) on remote machine and based on that file copy other files from sub-directories (where the filename.tup file was found). here is my trial script. use File::Basename ; @tuppaths=ssh$host "/usr/

Tags: perl, ssh
• ## perl script to find matching lines in two files2015-02-04

I have two files that look like (below) and want to find the fields from the first in the second file, but print every field of the second. #rs116801199 720381 #rs138295790 16057310 #rs131531 16870251 #rs131546 16872281 #rs140375 16873251 #rs131552 1

Tags: perl, string matching

Tags: perl
• ## Is there a way to keep perl test data in memory between test runs?2015-01-26

When I run my test cases via prove, it takes about 20 - 25 seconds to load my test data before the first test runs. Is there a way I could have a separate, persistent process load the test data in memory, and prove just retrieve a copy instantly each

Tags: testing, perl
• ## file watching in a directory using perl2015-01-19

i need to watch files that fall under a directory.I have coded the below script in perl . but it is not doing what i want . whenever a file or files arrives , it has to do a movement . And then it has to keep watching files again. the script should b

Tags: perl, file watcher
• ## Perl how to provide full or absolute path to fcopy() function2015-01-19

I am new to perl and want to write a basic program to copy the entire directory contents to another directory. My first hurdle is that I need to give the absolute path for source and destination and I can't seem to get the following code to do that:

Tags: perl, absolute path