diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-05-22 15:02:08 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-05-22 15:02:08 +0000 |
commit | c8a14fb6c15fa7e7d9f1ce7bc6160eab4bca36af (patch) | |
tree | 7aa6c43184e0e65e5483b1f8f6cda8cbbc2d71e3 /lib/version.pm | |
parent | 188f0c84c39131341bfb7749b35facb3de682e0f (diff) | |
download | perl-c8a14fb6c15fa7e7d9f1ce7bc6160eab4bca36af.tar.gz |
Upgrade to version.pm 0.60
p4raw-id: //depot/perl@28276
Diffstat (limited to 'lib/version.pm')
-rw-r--r-- | lib/version.pm | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/lib/version.pm b/lib/version.pm index 5af78ef5ca..460df33825 100644 --- a/lib/version.pm +++ b/lib/version.pm @@ -1,20 +1,36 @@ #!perl -w package version; -use 5.005_03; +use 5.005_04; use strict; -require Exporter; -use vars qw(@ISA $VERSION $CLASS @EXPORT); +use vars qw(@ISA $VERSION $CLASS *qv); -@ISA = qw(Exporter); - -@EXPORT = qw(qv); - -$VERSION = 0.53; +$VERSION = "0.60"; +$VERSION = eval($VERSION); $CLASS = 'version'; +eval "use version::vxs $VERSION"; +if ( $@ ) { # don't have the XS version installed + eval "use version::vpp $VERSION"; # don't tempt fate + die "$@" if ( $@ ); + push @ISA, "version::vpp"; + *version::qv = \&version::vpp::qv; +} +else { # use XS module + push @ISA, "version::vxs"; + *version::qv = \&version::vxs::qv; +} + # Preloaded methods go here. +sub import { + my ($class, @args) = @_; + my $callpkg = caller(); + no strict 'refs'; + + *{$callpkg."::qv"} = + sub {return bless version::qv(shift), $class }; +} 1; |