blib/lib/Perlmazing/Perlmazing/shuffle.pm untested

filter: Statementstmt 0.0% 0 / 22 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 34 CC 5 SCAR 30.9
CC
5
Cov
0%
main
30.0
BEGIN
2.0
BEGIN
2.0
CRAP 22.0
1 use Perlmazing;
2 use List::Util ();
3  
4 sub main {
5 my @call = caller(0);
6 my @copy = List::Util::shuffle(@_);
7 if (wantarray) {
8 return @copy;
9 } elsif (defined wantarray) {
10 return $_[0];
11 } else {
12 for (my $i = 0; $i < @copy; $i++) {
13 eval {
14 $_[$i] = $copy[$i];
15 };
16 if (my $e = $@) {
17 if ($e =~ /^Modification of a read\-only value attempted/) {
18 die "Modification of a read-only value attempted at $call[1] line $call[2]\n";
19 } else {
20 die "$e\n...from call at $call[1] line $call[2]\n";
21 }
22 }
23 }
24 }
25 }
26  
27 1;