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
2 answers

Why does strict complain about variables from a required other script?

This is usex.pl: #use strict; require 'x.pl'; print $x; Here is x.pl: #use strict; our $x = 99; 1; It runs fine as shown. If I uncomment the line to use strict in usesx.pl, I get Global symbol "$x" requires explicit package name The use or not…
DarenW
  • 16,549
  • 7
  • 63
  • 102
0
votes
1 answer

How to manipulate a DOM element while running a perl mechanize script?

This post discusses how to inform the user via a progress bar by calculating the percentage of the file being downloaded by a www::mechanize Perl script. I need to inform my user of a www::mechanize script's progress but not necessarily in…
Ricalsin
  • 950
  • 9
  • 28
0
votes
1 answer

Error using intermediate variable to access Spreadsheet::Read sheets

I'm no expert at Perl, wondering why the first way of obtaining numSheets is okay, while the following way isn't: use Spreadsheet::Read; my $spreadsheet = ReadData("blah.xls"); my $n1 = $spreadsheet->[1]{sheets}; # okay my %sh =…
DarenW
  • 16,549
  • 7
  • 63
  • 102
-1
votes
1 answer

How to get the header of the html page

I am using HTTP::Request for getting the header of the xml feed, but when I am printing the header tag or field its is printing empty string. use HTTP::Request; use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $request =…
made_in_india
  • 2,109
  • 5
  • 40
  • 63
-1
votes
2 answers

How to convert a PDF file to a DOC file using Perl?

Is there any module available for this? I tried searching on Google but didn't find. Let me know if there exists any.
Chankey Pathak
  • 21,187
  • 12
  • 85
  • 133
-1
votes
2 answers

Inputs for Porting Perl

I am a very new to porting. I was trying to port perl to a netbsd system. Since its a custom made build, we wont be able to run configure or make on the target netbsd system. So we are trying to cross-compile it in a host pc and copy the binary over…
Shyama
  • 1
-1
votes
2 answers

PERL - AD account add - check if account exists already

I would like to create a script that would add an AD account, but check for duplicates first. Lets just say $first = John $last = Doe The naming convention is "DoeJ" If "DoeJ" already exists (example: Jane Doe), then it should be last name, first 2…
Will Fix
  • 105
  • 1
  • 4
  • 16
-1
votes
2 answers

Sharing variables between multiple submodules

I have a module foo that has extended sub-modules bar and baz. I want bar and baz to modify the same set of hashes that are in foo. Right now I have something like: my $foo = new foo; my $bar = new foo::bar( $foo…
anonymous
  • 31
  • 4
-1
votes
1 answer

If I change the _pdpstep and heartbeat the RRD not updated properly

I have rrd file "abcd" with _pdpstep = 300 and heartbeat = 700. If this is the configuration then it works fine means accept value. But If I create this file newly with _pdpstep = 1200 and heartbeat = 1500 then it gives all value as Nan. How Can I…
-1
votes
1 answer

How do we sort a multi dimensional hash based on the value?

I have an hash which looks like this when I use dumper: { hello => { pqr => { a => 455, b => 52, c => "hello" }, lmn => { a => 3, b => 39, c => "hi" } }, hi => { suv => { a =>…
Sai Kiran
  • 145
  • 1
  • 2
  • 5
-1
votes
2 answers

Thead safe HTTP client module

Which module would you recommend for thread safe HTTP client? [ Alternative: event based multi-session HTTP client ] Extra requirements: Support for retries (use of partially downloaded big files) Shared cookies Provided as Debian…
AnFi
  • 10,493
  • 3
  • 23
  • 47
-1
votes
1 answer

rename the specific file with current time stamp using perl script for windows

I am using the below script to rename but it is renaming the all file end with STA.I need to rename the file that starts with KRAT or TRAT. #!/usr/local/bin/perl use strict; use warnings; use File::Copy; my $directory = 'C:\Users\Desktop';…
kunal
  • 3
  • 2
-1
votes
1 answer

How to call a perl script in html

How to call a perl script which is returning data "text" type inside a html file.Posting the perl script for reference.This script has to be called in the index.html so how to do that #!/usr/bin/perl -w use CGI; my $cgi = CGI->new; my…
BeastLesnar
  • 71
  • 1
  • 3
  • 7
-1
votes
2 answers

perl use vs require and import, constants are only functions

I've got a Perl script that I'm trying to make compatible with two different Perl environments. To work around the two different versions of Socket I have, I'm doing a little hackery with require and import. I've got it working, but I'm not happy…
TOertel
  • 29
  • 7
-1
votes
1 answer

Perl script Lookup timestamp in a log file

I have to make a modification to an existing PERL script. As I have no experience in PERL Scripting i googled and made a change but that's not working. So there is part that checks if a specific timestamp exists in the file. the code is while…
Ilhan
  • 3
  • 1