Subject: | reap() clobbers return values of the caller |
The reap() function changes the return values of the caller, see:
perl -MScope::Upper=reap,UP -Mstrict -MData::Dumper -le '
sub xx {reap sub {1234}, UP}
sub yy {xx; return 23}
my @l=yy;
print Dumper \@l;
my $l=yy;
print $l'
$VAR1 = [
23,
1234 <== this is added by reap()
];
1234 <== in scalar context reap() overrides
the original value
if you need more detail reach me via torsten.foertsch@gmx.net