perl-module

OS specific tests for Perl test scripts

Is there a more elegant way to write the portion of the test script which is O/S dependant? Please refer to the code below the comment line. Background: Module Perl::Tags creates a tags file for VIM. On Win32 the directory separator is "\" but on other OS's it is "/". Vim's Perl-support module seems to read the tags file quite happily,...

How do I install deps for CPAN module without installing it?

This is a follow-up to my previous question about developing Perl applications. Let’s say I develop an application as a CPAN module using Module::Install. Now I upload the code to the production server, say using a git push, and I would like to install the application dependencies listed in Makefile.PL. If I simply run cpan ., the thing ...

How to Subselect with DBIx::Class?

I'm starting with DBIx::Class and i have a subselect that wanted to be in DBIx::Class, but i'm getting confused and can't build the code. My MySQL select is this one: Select name from tblCategory where id = ( Select id from tblCategory where id = ( Select id from tblRadio where name = "RFM" ) ); I read that DBIx::Cla...

In Perl, how do I put multiple packages in a single .pm file?

I'm pretty sure that I read somewhere that it's possible, but there are a few gotchas that you need to be aware of. Unfortunately, I can't find the tutorial or page that described what you need to do. I looked through the Perl tutorials, and didn't find the one that I remember reading. Could someone point me to a page or document that de...

How do I install a module and its dependencies in ActivePerl on Windows?

I want to send emails using gmail's smtp servers and perl. I am trying to install Email::Send::Gmail, but it is not clear to me what are the steps to install it. It seems that it depends on other modules that I do not have installed. ...

Perl: How can I call object methods inside END {} without warning?

package JustTesting; use strict; use warnings; sub new { my $self = {}; bless($self, shift); END { $self->goodbye() }; return $self; } sub goodbye { print "Goodbye.\n"; } package main; my $this = JustTesting->new(); Output: Variable "$self" will not stay shared at ./test line 10. Goodbye. Apparently it wo...

What does 1; mean in Perl?

I have come across a few Perl Modules that for example look similar to the following code: package MyPackage; use strict; use warnings; use constant PERL510 => ( $] >= 5.0100 ); require Exporter; our @ISA = qw(Exporter); our @EXPORT = qw( ); { #what is the significance of this curly brace? my $somevar; sub Somesub { ...

How can I tell what modules were originally provided with the specific Perl installation on a machine?

How can I tell what modules were originally provided with the specific Perl installation on a machine? (This is not a duplicate of: http://stackoverflow.com/questions/2049735 ( "How can I tell if a Perl module is core or part of the standard install?" ) - it is in fact a spin-off question from it ) I am looking for what came with the i...

What's a good way to refactor a monster Perl module into submodules?

I have a Perl module for a project. I have maybe a dozen programs hanging off it and a lot of it is garbage. I hadn't spent much close personal time with DBI before, so that part is fixable, but the big thing is that it is big. Literally 2KLOCs. It would be easy to break up this function (let's call it Dumb.pm) into separate modules ( ...

Problem installing Perl module Java::Import

I am trying to install the Java::Import module on my Win32 system for Perl 5.10. But I can't seem to get it install from cpan. Here is the error I get when I try to install it via CPAN: gcc -c -I"src" -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC -DPERL_I MPLICIT_CONTEXT -DPERL_I...

Ruby equivalent of Perl Data::Dumper

I am learning Ruby & Perl has this very convenient module called Data::Dumper, which allows you to recursively analyze a data structure (like hash) & allow you to print it. This is very useful while debugging. Is there some thing similar for Ruby? ...

Need good resources that guide through the process of creating Perl Modules/Packages

I work as an ETL developer and I have been meaning to create a Perl module where I can put a lot of the subroutines. I would also like, if it is possible, to have the module handle all the logging & error reporting although the second one is more of a nice to have than an immediate need. I have never created a module or package in Perl...

Why does a module compile by itself but fail when used from elsewhere?

I have a Perl module that appears to compile fine by itself, but is causing other programs to fail compilation when it is included: me@host:~/code $ perl -c -Imodules modules/Rebat/Store.pm modules/Rebat/Store.pm syntax OK me@host:~/code $ perl -c -Imodules bin/rebat-report-status Attempt to reload Rebat/Store.pm aborted Compilation fai...

What's wrong with my CGI::Session installation?

I installed CGI::Session module on my host by creating the perl-modules directory in my cgi-bin and then extracting the module to that directory so I have: D: cgi-bin/perl-modules/CGI/ F: cgi-bin/perl-modules/CGI/Session.pm D: cgi-bin/perl-modules/CGI/Session/ F: cgi-bin/perl-modules/CGI/Session/File.pm D: cgi-bin/perl-modules/CGI/Sessi...

How can I use vendor-packaged modules from a Perl I compiled myself?

Hello! My OS-Distribution provides the rpm-package "perl-obexftp", which installs the Modul "OBEXFTP". These are the files: /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/OBEXFTP.pm /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/auto/OBEXFTP /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/au...

How can I import Perl code from external files at compile time?

Help Perlers! Does anyone know a simple "insert code here" approach would bring code from external files once at compile time into a package? Background: I have a standard PBP-style inside-out class that is getting quite large. I want to split the code into multiple files but not extend the class. Optimally, I would simply insert th...

Active State Perl - IOCP

Hi People, I am thinking to use IOCP in perl in one of our network related code. Currently Active State Perl till 5.10 doesn't offer this feature? Is anyone aware of free module to use ASIO feature like IOCP in perl? -Karthik ...

In Perl, how can I import a hash from a library?

I have a file revs.pm: my %vers = ( foo => "bar" ); And another file like importer.pl: use revs; How can I access %vers from importer.pl ? ...

How should I distribute a pre-built perl module, and what version of perl do I build for?

This is probably a multi-part question. Background: we have a native (c++) library that is part of our application and we have managed to use SWIG to generate a perl wrapper for this library. We'd now like to distribute this perl module as part of our application. My first question - how should I distribute this module? Is there a sta...

Which Perl modules can be installed just by copying lib files?

I'm an absolute beginner at Perl, and am trying to use some non-core modules on my shared Linux web host. I have no command line access, only FTP. Host admins will consider installing modules on request, but the ones I want to use are updated frequently (DateTime::TimeZone for example), and I'd prefer to have control over exactly which ...