[Purdue-pm] Libraries have me befuddled

Dave Jacoby jacoby at purdue.edu
Thu Aug 29 13:04:03 PDT 2013

I've hit some weirdness in a software migration.

So, I've set it up so I'm adding my libs to the PERL5LIB environment 
variable instead of 'use lib "foo"', so I can move 'em into production 
without changing a 'use lib' line in more than a dozen modules.

When I'm using libraries directly, this is turning out fine. But, part 
of what I'm doing is putting commonly used functions in one module and 
using them in another.

So, I have SecGenTools::Run. It has six other SecGenTools modules.

     use SecGenTools::CV ;
     use SecGenTools::Misc ;
     use SecGenTools::Operator ;
     use SecGenTools::Recipe ;
     use SecGenTools::Accession ;
     use SecGenTools::Request ;

In general, my modules start with:

     use Exporter qw(import) ;
     our @EXPORT ;
     our %EXPORT_TAGS ;
     our @EXPORT_OK ;
     BEGIN {
         @EXPORT = qw{
             } ;
         %EXPORT_TAGS = ( 'all' => [ @EXPORT ] ) ;
         @EXPORT_OK = ( @{ $EXPORT_TAGS{ 'all' } } ) ;

The point being, there is code written against the libs that existed 
before I understood more than I do now. Used to be that you'd do this:

     use SecGenTools::CV ':all' ;

or, more rarely:

     use SecGenTools::CV 'make_analysis_types' ;

but I want to move to this most of the time.
     use SecGenTools::CV ;

I'm trying to test Run.pm, and I'm finding that this works:

     use SecGenTools::CV ':all' ;

and that this works:

     use lib '/home/djacoby/dev/Tools/lib' ;
     use SecGenTools::CV ;

but this does not:

     use SecGenTools::CV ;

Undefined subroutine &SecGenTools::Run::get_accession_data called at 
/home/djacoby/dev/Tools/lib/SecGenTools/Run.pm line 510.

I'm trying to pull this into repeatable chunks, so I can begin to dig in 
and find the solution, but as is, I'm befuddled.

Dave Jacoby
     Code Maker, Purdue Genomics Core Lab
         221 days until the end of XP support


More information about the Purdue-pm mailing list