Questions tagged [perl-module]

A Perl module is a reusable portion of Perl code.

In Perl, modules are vital to object-oriented design and can provide static variables referenced similarly to those in C++. The package model improves code organization, by allowing the coder to import functions from external files and 'bless' new object instances. Further, perl allows the directory structure holding modules to aid in the description of an object hierarchy. Perl module files traditionally have the extension '.pm'

see perlmod - perldoc.perl.org for more information.

1358 questions
6
votes
3 answers

How to include a file that contains all the required Perl module names?

The perl scripts contain all the module names in the beginning of the script. Ex: use strict; use XML::Parser; use XML::Simple; use DBI; use DBD::DB2::Constants; use POSIX qw( strftime ); use Storable qw(dclone); use Data::Dumper; use Carp; How to…
Sourcecode
  • 305
  • 4
  • 13
6
votes
3 answers

Read MS Word table data row wise using win32:ole perl

I am new to win32:ole module in perl. I am trying to print MS word table data row wise on command prompt. But I am able to print only last row of the table. Can you please help me to solve this problem? Thanks in advance. Below is my …
Aparna Savant
  • 337
  • 1
  • 6
  • 18
6
votes
1 answer

Installing JSON::XS on Mac OSX

I hope you're all ready for a long adventure through my frustration: I'm using Perl 5.10, on Mac OSX : Snow Leopard, with XCode 3.2.6. What I am trying to do is use the module JSON::XS in a program. This is the first time that I've ever done…
user1718471
  • 61
  • 1
  • 2
6
votes
4 answers

How does DBIx::Class handle boolean values?

I'm using DBIx::Class in my perl script to interact with a sqlite database. When doing inserts/searches, what will DBIx::Class consider 'true' and 'false'? eg: $schema->resultset('SomeObject')->create({ some_boolean => 1, primary_key => 1…
Blaskovicz
  • 6,122
  • 7
  • 41
  • 50
6
votes
4 answers

Using Perl to parse a CSV file from a particular row to the end of the file

am very new to Perl and need your help I have a CSV file xyz.csv with contents: here level1 and er values are strings names...not numbers... level1,er level2,er2 level3,er3 level4,er4 I parse this CSV file using the script below and pass the fields…
hi123
  • 117
  • 2
  • 9
6
votes
1 answer

How do I install Net::Pcap for Strawberry Perl in Windows 7?

I try to install Net::Pcap in Windows, but it gives the following error messages: c:\P P> cpan cpan> install Net::Pcap socket.h patched... ok looking for -lwpcap... yes checking for pcap_lib_version() in -lwpcap... no - - - - - - - - - - - - - - -…
P P
  • 137
  • 3
  • 13
6
votes
1 answer

Perl: Should Math64::Int64 work inside a "Safe" Compartment?

(My first post to stack overflow, hope I am using the right format) I have a need to evaluate code that manipulates 64-bit integers in a "Safe" compartment. Since I supply both the script and the code to be evaluated, I could do a normal eval, but I…
rbrunner
  • 61
  • 1
5
votes
3 answers

Kill a hung child process

My Perl script runs an external program (which takes a single command-line parameter) and processes its output. Originally, I was doing this: my @result = `prog arg`; However, turns out that the program is buggy and hangs unpredictably in rare…
Vess
  • 117
  • 3
  • 7
5
votes
4 answers

Perl & CPAN upgrade help for OS X

Here is my problem. I am running OS X v10.7 (Lion) and want to set up an old Perl program I have written (was then using a Windows System with ActivePerl and then its ppm). I read to use CPAN to install Perl modules (I am trying to install the Graph…
jjNford
  • 5,170
  • 7
  • 40
  • 64
5
votes
4 answers

How can I run a test in my Perl module's test suite only if the required module is installed?

I want to add a test to my Perl distribution that requires a module Foo, but my distribution does not require Foo; only the test requires Foo. So I don't want to add the module to the dependencies, but instead I just want to skip the tests that…
Ryan C. Thompson
  • 40,856
  • 28
  • 97
  • 159
5
votes
2 answers

Perl module loading - Safeguarding against: perhaps you forgot to load "Bla"?

When you run perl -e "Bla->new", you get this well-known error: Can't locate object method "new" via package "Bla" (perhaps you forgot to load "Bla"?) Happened in a Perl server process the other day due to an oversight of mine. There are multiple…
Lumi
  • 14,775
  • 8
  • 59
  • 92
5
votes
4 answers

How to build a MANIFEST file for a Perl module

I create some modules without using Module::Starter :(. I need to build a MANIFEST file to run my tests. Should I do it by hand, or is there an automated way to build it ?
smonff
  • 3,399
  • 3
  • 36
  • 46
5
votes
1 answer

Include constant in pod

Is it possible to include the contents of a constant in the POD for a module. Example: use constant DEFAULT_URL => "http://www.example.com"; ... =item B Change the URL to query. Default is [contents of DEFAULT_URL here] =cut
Markus
  • 809
  • 5
  • 10
5
votes
5 answers

installing Net/SSH/Perl.pm

I am fairly new to scripting with perl. I am trying to ssh into a server and perform some commands. I have to provide a username and password. When trying to run the script that i have so far (code listed below). I get the following error. I am…
prolink007
  • 33,872
  • 24
  • 117
  • 185
5
votes
1 answer

Where to install gpsbabel so it works with GPS::Babel perl module?

I'm sad that I have to ask a question this simple but where should gpsbabel be installed in order to work with the GPS::Babel perl module? I can't seem to figure out the appropriate path and am hoping someone else who has it working can help. Thanks…
Russell C.
  • 1,649
  • 6
  • 33
  • 55