Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
What purpose can that anonymous subroutine definition ($sub) possibly be serving, considering that it's not referenced anywhere?sub except (&;$) { my $code = shift; my $clauses = shift || {}; my $catch = $clauses->{'catch'} ||= []; my $sub = sub { my $ref; my(@array) = $code->($_[0]); if(@array == 1 && ref($array[0])) { $ref = $array[0]; $ref = [ %$ref ] if(UNIVERSAL::isa($ref,'HASH')); } else { $ref = \@array; } @$ref }; unshift @{$catch}, undef, $code; $clauses; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Useless code in Error.pm?
by Juerd (Abbot) on Apr 11, 2002 at 08:16 UTC | |
by Anonymous Monk on Apr 11, 2002 at 08:21 UTC |