http://qs1969.pair.com?node_id=501957


in reply to Re: "last expression" quiz
in thread "last expression" quiz

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

perl -e 'print sub {my $x=5; do {print "."} while $x--}->()'
but the sub just seems to return 0. Can you give an example? (Also, what version of Perl are you using?)