Mailing List Archive

obscure bug
I thought I was done futzing with bugs in perl until this one
came along and hit me :-) Here's the distillate from a larger
body of code.

The call to each() seems to lead to a corrupted op TARG during the
subsequent function call. Tracking it down is rather like watching
a loose bullet in a steel vault: gives you crossed-eyes and a headache.


sub Duh {
my $val = shift;
my $out = ""; # local too

if ($val) {
while ((undef, undef) = each %$val) {} # any body, LHS vars/undef
$out = 'xxx' . $out;
}
else {
$out = 'yyy' . $out;
}
}
print Duh({ a => *any }), "\n";
print Duh(), "\n";
__END__
xxx
*main::yyy


Identical behavior on 5.000, 5.001m and 5.001m+my_patches, all on
SunOS 4.1.3.


- Sarathy.
gsar@engin.umich.edu