• wikiprep MediaWiki::DumpFile namespace 2018-07-10

    I am trying to use wikiprep with support of MediaWiki::DumpFile to parse wikipedia dump. The problem is it doesn't work. wikiprep -format composite -compress -f enwiki.xml.0001.gz Can't locate object method "namespaces" via package "MediaWi

    Tags: perl, parsing, wikipedia
  • stomp+activemq+perl+cannot sysread(): EOF 2018-05-10

    I have a simple stomp script to connect to a activemq and when i run the script i get the below error "cannot sysread(): EOF" Perl Script Code: #!/usr/bin/perl use Net::STOMP::Client; $stomp = Net::STOMP::Client->new(uri => "stomp://h

    Tags: perl, activemq, stomp
  • Perl Parallel::ForkManager , takes long time with fork condition changed 2018-01-31

    I have two questions with Parallel::ForkManager , in modifing the pid condition. Question 1 : with a simple example, use strict; use warnings; use Parallel::ForkManager; use IO::Socket ; my $np = 32 ; my $pm = Parallel::ForkManager->new($np); $| = 1

    Tags: perl, fork, dictionary
  • perl - Extract data using grep and sed 2017-11-12

    I'm using this code to get all titles from urls with http://something.txt: #!/usr/bin/perl -w $output = `cat source.html | grep -o '<a .*href=.*>' | grep -E 'txt' | sed -e 's/<a /\n<a /g' | sed -e 's/<a .*title="//' | cut -f1 -d '"

    Tags: perl, grep, html parsing, sed
  • Perl created files with future timestamps on FreeBSD 9.3 2017-11-03

    I just encountered some strange behavior with Perl 5.16.3 on FreeBSD 9.3-RELEASE-p3. We've got a cron job which runs every five minutes and generates some text status files. I just happened to list the contents of the output directory and saw that th

    Tags: perl, file io, freebsd
  • Combine an Array object with scalar value within a scalar? Perl 2017-09-19

    I'm trying to combine an item from an Array list with a scalar $range. Here's how I'm trying to do it. my $rowinc = 2; my $colarray = @collet[0]; my $range = $colarray $rowinc; chomp $range; $sheet->Range($range)->{Value} = $ir; shift @collet; $shee

    Tags: perl
  • Need to parse utf8 email with perl 2017-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) Use of uninitialized value $_ in map 2017-08-13

    I am trying to export query result to CSV file using this code : while (my $query_result = $query_select->fetchrow_arrayref) { print $fh join (',', map {s{"}{""}g; "=\"$_\"";} @$query_result), "\n"; } and ge

    Tags: perl, initialization, export to csv
  • perl list path of subdirectory using File::Find 2016-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 hash 2016-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 perl 2016-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
  • Why is there a + before the first left parenthesis following print in this Perl example? 2015-10-07

    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 redirection 2015-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 script 2015-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 error 2015-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 files 2015-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
  • Input multiple files in perl 2015-02-02

    I have a perl script to do something like this : insert 10 file .txt (button) print each url to text area proces with tokenizer here's the script : sub Main_Menu{ # -------------------- # Create GUI interface # -------------------- my $mw = MainWindo

    Tags: perl, perl data structures, multiple files
  • How to assign variable value to constant in perl? 2015-01-29

    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; Currently my code is with respect to constant. Now I wa

    Tags: perl

Copyright (C), All Rights Reserved.

processed in 0.691 (s). 7 q(s)