perl

Is there any current review of statistical modules for Perl?

Hello, I would like to know which is the current status of the statistical modules in CPAN, does any one know any recent review or could comment about its likes/dislikes with those modules? I have used the clasical: Statistics::Descriptive, Statistics::Distributions, and some others contained in Bundle::Math::Statistics Some of the ...

How can I find the full URL from a relative URL in Perl?

I'm new to perl but was wondering if anyone know of a script that was similar to the following PHP version which works great! private function resolve_href ( $base, $href ) { if (!$href) return $base; $rel_parsed = parse_url($href); if (array_key_exists('scheme', $rel_parsed)) return $href; $base_parsed =...

Why won't a module installed by `cpanm` be recognized?

I installed perl-5.12.2 using perlbrew: perlbrew install perl-5.12.2 -D=usethreads -D=useithreads -D=uselargefiles -f I then switched to this version and installed IPC::System::Simple using cpanm. However, when I try to run my script I get: Can't locate IPC/System/Simple.pm in @INC (@INC contains: /home/dave/workspace/proj1/scripts/...

How can I use Perl to open the Inbox through the Lotus Notes API?

I am able to open Lotus notes api using Perl, without errors, also I can get list of views that includes Inbox, but when I try to read messages from that view it appears empty? What might I be doing wrong? (in fact it seems like something might of changed on notes side as this code used to work before) Result of code below: NAME of View...

What is the best way to match only letters in a regex?

I would really like to use \w but it also matches underscores so I'm going with [A-Za-z] which feels unnecessarily verbose and America centric. Is there a better way to do this? Something like [\w^_] (I doubt I got that syntax right)? ...

Why do I get "Global symbol '$href_array' requires specific package name" in Perl?

I can't seem to get these arrays to work. I'm getting errors along the following lines: Global symbol '$href_array' requires specific package name What does this mean? Here's part of my code: sub scrape { my ( $self, $DBhost, $DBuser, $DBpass, $DBname ) = @_; my ($dbh, $query, $result, $array); my $DNS = "dbi:mysql:$DBname:$DBhost:33...

Associate 2 table values in perl

Hi, I have 2 tables in mysql database: CUSTOMER and GROUP The CUSTOMER table: NAME |PHONE A |222 B |333 C |777 D |888 E |111 F |555 and so on. The GROUP table has only 3 value: GN | NUM NEW |807 OLD |455 INT |504 I would like to get the following result: A, NEW, 807 B, OLD, 455...

Is there a Perl extension for Visual Studio?

Does anyone know if there is an extension or plugin for Visual Studio ( any version ) that will recognize Perl syntax highlighting? I want to edit the Perl files in my vs projects, but it gets hard to read sometimes. Thanks. ...

Why does Perl's URI complain "Can't locate object method "host" via package "URI::_generic"'?

HI, im trying to get the host from a url. sub scrape { my @m_error_array; my @m_href_array; my @href_array; my ( $self, $DBhost, $DBuser, $DBpass, $DBname ) = @_; my ($dbh, $query, $result, $array); my $DNS = "dbi:mysql:$DBname:$DBhost:3306"; $dbh = DBI->connect($DNS, $DBuser, $DBpass ) or die $DBI::errstr; if( defined( $self->{_process...

How do I create an HTML table in Perl?

How do I create an HTML table in Perl? ...

Why can't I fetch www.google.com with Perl's LWP::Simple?

Hi, I cant seem to get this peice of code to work: $self->{_current_page} = $href; my $response = $ua->get($href); my $responseCode = $response->code; if( $responseCode ne "404" ) { my $content = LWP::Simple->get($href); die "get failed: " . $href if (!defined $content); } Will return error: get faile...

How do I create a simple HTML table with hyperlinks from a hash in Perl?

I have a Perl hash of "people" like this: my $data = { 124535 => { NAME => "abe", AGE => 100, SEX => "m", HOMEPAGE => qw (http://abe.knaan.old) }, 54478 => { NAME => "joe", AGE => 18, SEX => "m", HOMEPAGE => qw (http://slappy.joe.com)...

How can I convert dates to required format in Perl?

I have current date as 1/10/2010 I need to convert it into 1 October 2010. Is there any module to convert? ...

How can I make part of a Perl regular expression optional?

I want match my @array = ( 'Tree' , 'JoeTree'); foreach (@array ) { if ( $_ =~ /^(Joe)Tree/gi) { print "matched $_"; } } It matching only JoeTree. It's not matching Tree ? ...

how to get file name on perl of windows popup?

I'm using json to open the user popup. I used to use basename( $_FILES['userfile']['name'] ) on php, how to do that on perl? Server side code: #!/usr/bin/perl use CGI; print "Content-type: text/html; Cache-Control: no-cache; charset=utf-8\n\n"; @allowedExtensions =("jpg","tiff","gif","eps","jpeg","png"); my $q = CGI->new(); my $...

How can I run the regedit.exe from a Perl script on Windows 2008 Server?

I have yet another subtle problem on Windows :( The following one-line perl script doesn't work: perl -e "system('regedit.exe /s C:\my.reg');" It really runs regedit.exe tool (I'm sure since I tried to run it w/o "/s" and saw confirmation dialogs), but it doesn't create a key in the registry. I tried to run regedit.exe /s C:\my.r...

How can I extract a file path from a Perl string?

I want to find the file name with fullpath from this string "[exec] /snschome/sns/ccyp/mb_ccsns/bb/cbil5/v85_8/amdocs/iamcust/bil/cl/business/handlers/ClReportsHandler.java:233: cannot resolve symbol" I want to extract /snschome/sns/ccyp/mb_ccsns/bb/cbil5/v85_8/amdocs/iamcust/bil/cl/business/handlers/ClReportsHandler.java and I a...

Perl File Handling question ?

Hi, I have names of all files in output.txt but I do not have folderpath in output.txt file. For Example, if filename = test.txt and its folderpath=/usr/local/bin than in output.txt file, I only have filename as test.txt output.txt files has many entries for filename, what I am trying to do is: Move all files present output.txt to s...

Why does DBIx::Class with multiple inheritance fail on update?

I have a DBIC schema, where all the classes use a common base class, and definition class. The base class loads common components, and overrides the update method in order to record changesets in an audit table. The definition class is a static class generated from the database. A typical class header looks something like: package Schem...

How can I recognize Windows file paths in a string in Perl?

I have been doing some searching for a regex that can be used as a rule to disallow users entering windows file paths without escaping the "\". So far I have found this expression [^\\]*$ However, this fails for the following: C:\\Program Files\\testing By fails I mean that it does not validate this string. Any he...