File Coverage

Bio/Root/Version.pm
Criterion Covered Total %
statement 14 14 100.0
branch 2 2 100.0
condition 3 3 100.0
subroutine 3 3 100.0
pod n/a
total 22 22 100.0


line stmt bran cond sub pod time code
1             package Bio::Root::Version;
2 296     296   1082 use strict;
  296         344  
  296         17179  
3              
4             =head1 SYNOPSIS
5              
6             package Bio::Tools::NiftyFeature;
7             require Bio::Root::RootI;
8              
9             # later, in client code:
10             package main;
11             use Bio::Tools::NiftyFeature 3.14;
12              
13             ## alternative usage: NiftyFeature defines own $VERSION:
14             package Bio::Tools::NiftyFeature;
15             my $VERSION = 9.8;
16              
17             # later in client code:
18             package main;
19              
20             # ensure we're using an up-to-date BioPerl distribution
21             use Bio::Perl 3.14;
22              
23             # NiftyFeature has its own versioning scheme:
24             use Bio::Tools::NiftyFeature 9.8;
25              
26             =head1 DESCRIPTION
27              
28             This module provides a mechanism by which all other BioPerl modules
29             can share the same $VERSION, without manually synchronizing each file.
30              
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.
34              
35             =head1 AUTHOR Aaron Mackey
36              
37             =cut
38              
39             our $VERSION = '1.007001';
40              
41             sub import {
42             # try to handle multiple levels of inheritance:
43 356     356   428 my $i = 0;
44 356         1391 my $pkg = caller($i);
45 296     296   1013 no strict 'refs';
  296         333  
  296         25447  
46 356         5797 while ($pkg) {
47 7318 100 100     56966 if ( $pkg =~ m/^Bio::/o
48 1653         8165 and not defined ${$pkg . "::VERSION"}
49             ) {
50 1310         1028 ${$pkg . "::VERSION"} = $VERSION;
  1310         3144  
51             }
52 7318         9143 $pkg = caller(++$i);
53             }
54             }
55              
56             1;
57              
58             __END__