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
0
votes
1 answer

user-input handling postgresql

I feel like I'm missing a very basic concept. I could use some clarification or reference material. On my website, I have a user that enters text into an input box and submits that to the database to be stored. I insert that text into the database…
fbynite
  • 2,651
  • 1
  • 21
  • 25
0
votes
3 answers

Equivalent to: import *

I am creating a Perl equivalent to my Python project. Description: I have a base module "base.py" that is used by all my scripts via "from base import *" The base module has common subroutines/functions that can be executed inside the scripts My…
ThePracticalOne
  • 641
  • 1
  • 8
  • 12
0
votes
1 answer

Modularising Gearman workers in Perl

I need to modularise gearman workers in Perl, so that I can just register different worker function name and their implementation and reuse all the other code. use strict; use warnings; use Getopt::Std; use JSON qw( decode_json ); use FindBin…
Imran Imtiaz
  • 65
  • 1
  • 7
0
votes
2 answers

Installing Class::Inspector Perl module

I am a windows 7 (64 bit) user. I was trying to install Class::Inspector module in Perl. However it requred Nmake15.exe. I have tried to download the exe and when I run it, there is an pop up message stating that The program or feature Nmake15.exe…
Yuen Li
  • 289
  • 1
  • 2
  • 7
0
votes
2 answers

How do I refresh an array in a foreach loop?

I am writing a Perl script to do some mathematical operations on a hash. This hash contains the values as given in the sample below. I have written the code below. If I execute this code for an array value separately without using a foreach loop,…
Space
  • 7,049
  • 6
  • 49
  • 68
0
votes
1 answer

can't connect through socket /opt/lampp/var/mysql/mysql.sock in perl

I am having trouble connecting to a database. Below is the Perl script that doesn't work: use DBI; my $dbh = DBI->connect( 'dbi:mysql:orders;mysql_socket:/opt/lampp/var/mysql/mysql.sock', $username, $password, { RaiseError => 0,…
pavan
  • 334
  • 6
  • 20
0
votes
2 answers

Argument to Perl module use

Having a C background, I may be trying to write something the wrong way so excuse the beginner question. Here is what I'm looking for : I'm willing to have a perl module Verbose (not a class) that define a subroutine called verbose_print(). This…
claf
  • 9,043
  • 17
  • 62
  • 79
0
votes
3 answers

Parse excel file with using Perl

I'm quite new in perl, so I'm asking for tips for the problem below : I have a excel file and I want to search for specific words in column title (1st row) then if it matches I extract the entire column and put it in a array (or whatever else). So…
Dakar
  • 3
  • 2
0
votes
1 answer

Can't load '/usr/lib/perl5/vendor_perl/5.8/msys/auto/XML/LibXML/Common/Common.dll' for module XML::LibXML::Common: dlopen: Win32 error 126

I'm stuck with this error: Can't load '/usr/lib/perl5/vendor_perl/5.8/msys/auto/XML/LibXML/Common/Common.dll' for module XML::LibXML::Common: dlopen: Win32 error 126 at /usr/lib/perl5/5.8 /msys/DynaLoader.pm line 230. at…
Stéphane V
  • 1,094
  • 2
  • 11
  • 25
0
votes
1 answer

setting up the 'inc' directory for a dist using Module::Package

As an example, the CPAN distribution Scalar-Does-0.006 uses Module::Package in its Makefile.PL, and the code for Module::Package resides in the sub-directory inc with files…
ErikR
  • 51,541
  • 9
  • 73
  • 124
0
votes
1 answer

Getting error "Can't locate HTML/TreeBuilder/XPath.pm in @INC "

Gettin below error while running my perl file Can't locate HTML/TreeBuilder/XPath.pm in @INC (@INC contains: C:/Perl/lib C:/Pe rl/site/lib .) at display.pl line 4. BEGIN failed--compilation aborted at display.pl line 4. HTML::TreeBuilder::XPath…
Cindrella
  • 1,671
  • 7
  • 27
  • 47
0
votes
2 answers

Creating an optimized pattern using Text::Balanced to format with Text::Markdown

I can run the following on a csv file in order to get the delimited text from the file. #!/usr/bin/perl use strict; use warnings; use Text::Balanced q/extract_delimited/; my $filecontents = do { local $/; <> }; while (my $item =…
capnhud
  • 443
  • 3
  • 13
  • 28
0
votes
1 answer

perl File::Tail delay

I'm using the perl File::Tail library to tail the output of a file and parse it's output. Everything's working fine except there seems to be about a 10 second delay after I start the script before it starts outputting. After the first read, it…
Zip184
  • 1,792
  • 2
  • 21
  • 34
0
votes
4 answers

How check whether csv file with header is empty or not in perl

I have a csv file xyz.csv with contents name,age,place,phone xyz,12,ohio,7372829 sed,23,hrh,9890908 I need to parse the csv file and check whether it is a empty file i.e. it doesn't have the values for the headers provided. a null file xyz.csv…
hi123
  • 117
  • 2
  • 9
0
votes
2 answers

Generate HTML web form from XML configuration file with Perl and vice versa

I am in need of assistance with the following problem. There is an application that I co-wrote and currently manage that is written in a combination C and Haskell. The application can be customized and configured via a single XML file. It is a…
Duke Bishop
  • 171
  • 1
  • 5