Add Root back, plus some test and doc fixes
[bioperl-live.git] / Bio / Root / Version.pm
blob7267b45fb0b49117a982fa7b26dc35b5b8f1ee3d
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.006925'; # pre-1.7
40 $VERSION = eval $VERSION;
42 sub import {
43 # try to handle multiple levels of inheritance:
44 my $i = 0;
45 my $pkg = caller($i);
46 no strict 'refs';
47 while ($pkg) {
48 if ( $pkg =~ m/^Bio::/o
49 and not defined ${$pkg . "::VERSION"}
50 ) {
51 ${$pkg . "::VERSION"} = $VERSION;
53 $pkg = caller(++$i);
59 __END__