| 1 | package Algorithm::Evolutionary; | ||||||||||
| 2 | |||||||||||
| 3 | 21 | ▶ | use Carp qw(croak); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 15 | our $VERSION = '0.82.1'; # Later than 1st GitHub version | |||||||||
| 6 | |||||||||||
| 7 | # Preloaded methods go here. | ||||||||||
| 8 | |||||||||||
| 9 | # A bit of importing magic taken from POE | ||||||||||
| 10 | 19 | ▶ | sub import { | ||||||||
|
Subroutine
import: called CC=4 SCAR=13.9
| |||||||||||
| 11 | 19 | my $self = shift; | |||||||||
| 12 | |||||||||||
| 13 | 17 | my @modules = grep(!/^(Op|Indi|Fitness)$/, @_); | |||||||||
| 14 | |||||||||||
| 15 | 17 | my $package = caller(); | |||||||||
| 16 | 18 | my @failed; | |||||||||
| 17 | |||||||||||
| 18 | # Load all the others. | ||||||||||
| 19 | 17 | foreach my $module (@modules) { | |||||||||
| 20 | 61 | my $code = "package $package; use Algorithm::Evolutionary::$module;"; | |||||||||
| 21 | # warn $code; | ||||||||||
| 22 | 21 | ▶ | eval($code); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 23 | 61 | ▶ | if ($@) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | 45 | warn $@; | |||||||||
| 25 | 45 | push(@failed, $module); | |||||||||
| 26 | } | ||||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 17 | ▶ | @failed and croak "could not import qw(" . join(' ', @failed) . ")"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | 15 | 1; | |||||||||
| 33 | __END__ | ||||||||||