Update of /cvsroot/module-build/Module-Build/lib/Module/Build
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20547/lib/Module/Build
Modified Files:
Tag: release-0_26_branch
Base.pm
Log Message:
Create an instance() method
Index: Base.pm
===================================================================
RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v
retrieving revision 1.340.2.6
retrieving revision 1.340.2.7
diff -C2 -d -r1.340.2.6 -r1.340.2.7
*** Base.pm 12 Dec 2004 04:09:43 -0000 1.340.2.6
--- Base.pm 12 Dec 2004 16:49:48 -0000 1.340.2.7
***************
*** 14,17 ****
--- 14,21 ----
use Text::ParseWords ();
+ # We use this to store the most-recently created M::B objects.
+ # Typically there's only one.
+ my @INSTANCE;
+
#################### Constructors ###########################
sub new {
***************
*** 30,36 ****
--- 34,46 ----
$self->dist_version;
+ push @INSTANCE, $self;
return $self;
}
+ sub instance {
+ die "No new Module::Build objects have been created in this process" unless @INSTANCE;
+ return $INSTANCE[-1];
+ }
+
sub resume {
my $self = shift()->_construct(@_);
|