package Foo::Bar ;
.....
our $VERSION = "0.00" ;
.....
####
my $obj = new Foo::Bar (...) ;
####
package Foo::Bar ;
use strict ; use warnings ;
our $VERSION = "1.01" ;
use base qw(Foo);
sub new { return bless [], shift ; } ;
1 ;
####
package Foo ;
use strict ; use warnings ;
our $VERSION = "0.11" ;
sub version {
my ($self) = @_ ;
no strict 'refs' ; # NB: seatbelt off.
return ${ref($self)."::VERSION"} ; # "Symbolic Reference"
} ;
1 ;
####
use strict ; use warnings ;
use Foo::Bar ;
my $obj = new Foo::Bar ;
print $obj->version(), "\n" ;
####
1.01