| 1 | package WWW::ORCID; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 1 | our $VERSION = 0.02_01; | |||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 1 | ▶ | use Class::Load qw(try_load_class); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | 1 | ▶ | use Carp; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | 1 | ▶ | use namespace::clean; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | 1 | my $DEFAULT_VERSION = '2.0'; | |||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | sub new { | ||||||||||||||||||||
| 15 | 0 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
new: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||
| 16 | 0 | ▶ | my $opts = ref $_[0] ? {%{$_[0]}} : {@_}; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 17 | 0 | ▶ | my $version = $opts->{version} ||= $DEFAULT_VERSION; | ||||||||||||||||||
|
Condition0%0/3
$opts->{"version"} ||= $DEFAULT_VERSION
MC/DC0%0/2
$opts->{"version"} ||= $DEFAULT_VERSION
$opts->{"version"}
$DEFAULT_VERSION
Truth table0%0/3
A ||= B
A= $opts->{"version"}B= $DEFAULT_VERSION
| |||||||||||||||||||||
| 18 | 0 | $version =~ s/\./_/g; | |||||||||||||||||||
| 19 | 0 | ▶ | $version .= '_public' if $opts->{public}; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 20 | 0 | my $class = "WWW::ORCID::API::v${version}"; | |||||||||||||||||||
| 21 | 0 | ▶ | try_load_class($class) or croak("Could not load $class: $!"); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 22 | 0 | $class->new($opts); | |||||||||||||||||||
| 23 | } | ||||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | 1 | 1; | |||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | __END__ | ||||||||||||||||||||