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
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--}->()'
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: "last expression" quiz
by Aristotle (Chancellor) on Oct 23, 2005 at 14:43 UTC | |
by robin (Chaplain) on Oct 23, 2005 at 15:14 UTC | |
by Aristotle (Chancellor) on Oct 27, 2005 at 05:37 UTC |
In Section
Seekers of Perl Wisdom