newest_newbie has asked for the wisdom of the Perl Monks concerning the following question:
anduse Module 1.0;
How can I achieve this. Should I have two Module.pm files? or should I have two sets of subroutines in the same file? I tried something like this, DID NOT WORK, it always picked the last defined subroutine.use Module 2.0;
Thanks in advance!!package Module; our ($VERSION, @EXPORT, @ISA); use Exporter; @ISA=qw#Exporter#; $VERSION = q#1.0#; sub routine1 { print "This is version: $VERSION\n"; } $VERSION = q#2.0#; sub routine1 { print "This is version: $VERSION\n"; } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Multiple versions of a module
by Fletch (Bishop) on Mar 16, 2007 at 18:48 UTC | |
|
Re: Multiple versions of a module
by Joost (Canon) on Mar 16, 2007 at 19:00 UTC | |
|
Re: Multiple versions of a module
by gam3 (Curate) on Mar 16, 2007 at 20:27 UTC | |
|
Re: Multiple versions of a module
by shigetsu (Hermit) on Mar 16, 2007 at 21:12 UTC | |
|
Re: Multiple versions of a module
by ferreira (Chaplain) on Mar 17, 2007 at 18:49 UTC |