| 1 | package UUID::Generator::PurePerl::RNG; | ||||||||||
| 2 | |||||||||||
| 3 | 11 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 11 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 11 | my $singleton; | |||||||||
| 7 | sub singleton { | ||||||||||
| 8 | 1 | ▶ | my $class = shift; | ||||||||
|
Subroutine
singleton: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||
| 9 | |||||||||||
| 10 | 1 | ▶ | if (! defined $singleton) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 11 | 1 | $singleton = $class->new(@_); | |||||||||
| 12 | } | ||||||||||
| 13 | |||||||||||
| 14 | 1 | return $singleton; | |||||||||
| 15 | } | ||||||||||
| 16 | |||||||||||
| 17 | sub new { | ||||||||||
| 18 | 3 | ▶ | shift; # class | ||||||||
|
Subroutine
new: called CC=4 SCAR=14.1
Pod
undocumented
| |||||||||||
| 19 | |||||||||||
| 20 | 3 | my @classes = qw( | |||||||||
| 21 | UUID::Generator::PurePerl::RNG::MRMT | ||||||||||
| 22 | UUID::Generator::PurePerl::RNG::MRMTPP | ||||||||||
| 23 | UUID::Generator::PurePerl::RNG::rand | ||||||||||
| 24 | ); | ||||||||||
| 25 | |||||||||||
| 26 | 3 | foreach my $class (@classes) { | |||||||||
| 27 | 9 | ▶ | next if ! eval qq{ require $class }; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | |||||||||||
| 29 | 9 | ▶ | next if ! $class->enabled; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | |||||||||||
| 31 | 3 | return $class->new(); | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 0 | return; | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 11 | 1; | |||||||||
| 38 | __END__ | ||||||||||