Bring base classes from BioPerl-run back to BioPerl.
[bioperl-live.git] / Bio / Root / Version.pm
blob27c1fdd65fc3b18473c82dc27048b3a7c2531a5b
1 package Bio::Root::Version;
2 use strict;
4 =head1 SYNOPSIS
6 package Bio::Tools::NiftyFeature;
7 require Bio::Root::RootI;
9 # later, in client code:
10 package main;
11 use Bio::Tools::NiftyFeature 3.14;
13 ## alternative usage: NiftyFeature defines own $VERSION:
14 package Bio::Tools::NiftyFeature;
15 my $VERSION = 9.8;
17 # later in client code:
18 package main;
20 # ensure we're using an up-to-date BioPerl distribution
21 use Bio::Perl 3.14;
23 # NiftyFeature has its own versioning scheme:
24 use Bio::Tools::NiftyFeature 9.8;
26 =head1 DESCRIPTION
28 This module provides a mechanism by which all other BioPerl modules
29 can share the same $VERSION, without manually synchronizing each file.
31 Bio::Root::RootI itself uses this module, so any module that directly
32 (or indirectly) uses Bio::Root::RootI will get a global $VERSION
33 variable set if it's not already.
35 =head1 AUTHOR Aaron Mackey
37 =cut
39 our $VERSION = '1.007002';
41 sub import {
42 # try to handle multiple levels of inheritance:
43 my $i = 0;
44 my $pkg = caller($i);
45 no strict 'refs';
46 while ($pkg) {
47 if ( $pkg =~ m/^Bio::/o
48 and not defined ${$pkg . "::VERSION"}
49 ) {
50 ${$pkg . "::VERSION"} = $VERSION;
52 $pkg = caller(++$i);
58 __END__