in reply to Re: Skeleton For Import to Package?
in thread Skeleton For Import to Package?
I guess I should just call everything I want to be main code from the import statement itself. still strange that import() is not the first thing called.package cacher; use strict; use warnings; use warnings FATAL => qw{ uninitialized }; # larry, this should have b +een part of warnings. use base 'Exporter'; our @EXPORT = ("pdfpagenum"); BEGIN { my $saved_pkg_args="undefined"; sub import { print "import args: ".join("|", @_)."\n"; $saved_pkg_args= $_[1]; print "in import, saved args '$saved_pkg_args'\n"; } sub test { print STDERR "in test, you have saved '$saved_pkg_args'\n +"; } print "this should executed after the import: $saved_pkg_args.\n" } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Skeleton For Import to Package?
by almut (Canon) on Jul 28, 2010 at 15:21 UTC |