If the last thing that happened was an iteration of the do {} while $cond or do {} until $cond pseudo-loop, you get back a code reference (whether the condition turned out true of false).
That sounds really strange, but sadly I can't reproduce it. I tried
but the sub just seems to return 0. Can you give an example? (Also, what version of Perl are you using?)perl -e 'print sub {my $x=5; do {print "."} while $x--}->()'
In reply to Re^2: "last expression" quiz
by robin
in thread "last expression" quiz
by fxn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |