« blib/lib/Perlmazing/Perlmazing/find_parent_classes.pm
↑ Summary
blib/lib/Perlmazing/Perlmazing/splitpath.pm »
| 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; |