File Coverage

blib/lib/Image/Caption.pm
Criterion Covered Total %
statement 18 35 51.4
branch 0 10 0.0
condition 0 3 0.0
subroutine 6 9 66.6
pod n/a
total 24 57 42.1


line stmt bran cond sub pod time code
1             package Image::Caption;
2              
3             require 5.005_62;
4 1     1   664 use strict;
  1         2  
  1         30  
5 1     1   5 use warnings;
  1         1  
  1         25  
6 1     1   5 use Carp;
  1         2  
  1         105  
7              
8             require Exporter;
9             require DynaLoader;
10 1     1   2195 use AutoLoader;
  1         1751  
  1         7  
11              
12             our @ISA = qw(Exporter DynaLoader);
13              
14             # Items to export into callers namespace by default. Note: do not export
15             # names by default without a very good reason. Use EXPORT_OK instead.
16             # Do not simply export all your public functions/methods/constants.
17              
18             # This allows declaration use Image::Caption ':all';
19             # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
20             # will save memory.
21             our %EXPORT_TAGS = ( 'all' => [ qw(
22            
23             ) ] );
24              
25             our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
26              
27             our @EXPORT = qw(
28             add_caption
29             );
30             our $VERSION = '0.01';
31              
32             sub AUTOLOAD {
33             # This AUTOLOAD is used to 'autoload' constants from the constant()
34             # XS function. If a constant is not found then control is passed
35             # to the AUTOLOAD in AutoLoader.
36              
37 0     0     my $constname;
38 0           our $AUTOLOAD;
39 0           ($constname = $AUTOLOAD) =~ s/.*:://;
40 0 0         croak "& not defined" if $constname eq 'constant';
41 0 0         my $val = constant($constname, @_ ? $_[0] : 0);
42 0 0         if ($! != 0) {
43 1 0 0 1   1135 if ($! =~ /Invalid/ || $!{EINVAL}) {
  1         1384  
  1         88  
  0            
44 0           $AutoLoader::AUTOLOAD = $AUTOLOAD;
45 0           goto &AutoLoader::AUTOLOAD;
46             }
47             else {
48 0           croak "Your vendor has not defined Image::Caption macro $constname";
49             }
50             }
51             {
52 1     1   6 no strict 'refs';
  1         1  
  1         153  
  0            
53             # Fixed between 5.005_53 and 5.005_61
54 0 0         if ($] >= 5.00561) {
55 0     0     *$AUTOLOAD = sub () { $val };
  0            
56             }
57             else {
58 0     0     *$AUTOLOAD = sub { $val };
  0            
59             }
60             }
61 0           goto &$AUTOLOAD;
62             }
63              
64             bootstrap Image::Caption $VERSION;
65              
66             # Preloaded methods go here.
67              
68             # Autoload methods go after =cut, and are processed by the autosplit program.
69              
70             1;
71             __END__