delayed evaluation of code in subroutines - 5.8 vs. 5.10 and 5.12
- by Brock
This bit of code behaves differently under perl 5.8 than it does under perl 5.12:
my $badcode = sub { 1 / 0 };
print "Made it past the bad code.\n";
[brock@chase tmp]$ /usr/bin/perl -v
This is perl, v5.8.8 built for i486-linux-gnu-thread-multi
[brock@chase tmp]$ /usr/bin/perl badcode.pl
Illegal division by zero at badcode.pl line 1.
…