| 1 | package Image::Caption; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 1 | require 5.005_62; | |||||||||||||||||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 1 | require Exporter; | |||||||||||||||||||||||||||
| 9 | 1 | require DynaLoader; | |||||||||||||||||||||||||||
| 10 | 1 | ▶ | use AutoLoader; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 1 | 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 | 1 | our %EXPORT_TAGS = ( 'all' => [ qw( | |||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | ) ] ); | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 1 | our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); | |||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 1 | our @EXPORT = qw( | |||||||||||||||||||||||||||
| 28 | add_caption | ||||||||||||||||||||||||||||
| 29 | ); | ||||||||||||||||||||||||||||
| 30 | 1 | our $VERSION = '0.01'; | |||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 0 | ▶ | sub AUTOLOAD { | ||||||||||||||||||||||||||
|
Subroutine
AUTOLOAD: not called CC=7 SCAR=35.7
| |||||||||||||||||||||||||||||
| 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 | my $constname; | |||||||||||||||||||||||||||
| 38 | 0 | our $AUTOLOAD; | |||||||||||||||||||||||||||
| 39 | 0 | ($constname = $AUTOLOAD) =~ s/.*:://; | |||||||||||||||||||||||||||
| 40 | 0 | ▶ | croak "& not defined" if $constname eq 'constant'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 41 | 0 | ▶ | my $val = constant($constname, @_ ? $_[0] : 0); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 42 | 0 | ▶ | if ($! != 0) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 43 | 0 | ▶ | if ($! =~ /Invalid/ || $!{EINVAL}) { | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
Branch: 1 branch
Condition0%0/3
$! =~ /Invalid/ or $!{"EINVAL"}
MC/DC0%0/2
$! =~ /Invalid/ or $!{"EINVAL"}
$! =~ /Invalid/
$!{"EINVAL"}
Truth table0%0/3
A or B
A= $! =~ /Invalid/B= $!{"EINVAL"}
| |||||||||||||||||||||||||||||
| 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 | 0 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.2
| |||||||||||||||||||||||||||||
| 53 | # Fixed between 5.005_53 and 5.005_61 | ||||||||||||||||||||||||||||
| 54 | 0 | ▶ | if ($] >= 5.00561) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 55 | 0 | ▶ | *$AUTOLOAD = sub () { $val }; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||
| 57 | else { | ||||||||||||||||||||||||||||
| 58 | 0 | ▶ | *$AUTOLOAD = sub { $val }; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||
| 61 | 0 | goto &$AUTOLOAD; | |||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | 1 | 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 | 1; | |||||||||||||||||||||||||||
| 71 | __END__ | ||||||||||||||||||||||||||||