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   1748 use strict;
  296         549  
  296         19746  
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.007002';
40              
41             sub import {
42             # try to handle multiple levels of inheritance:
43 356     356   812 my $i = 0;
44 356         1857 my $pkg = caller($i);
45 296     296   1597 no strict 'refs';
  296         530  
  296         28288  
46 356         7501 while ($pkg) {
47 7327 100 100     80324 if ( $pkg =~ m/^Bio::/o
48 1656         8643 and not defined ${$pkg . "::VERSION"}
49             ) {
50 1313         1627 ${$pkg . "::VERSION"} = $VERSION;
  1313         3686  
51             }
52 7327         10377 $pkg = caller(++$i);
53             }
54             }
55              
56             1;
57              
58             __END__