in reply to Re: looking for a good idiom: return this if this is true
in thread looking for a good idiom: return this if this is true
The || operator is the high priority logical or, so if thatroutine() evaluates false, die is evaluated before return is.
Update: Oops, I misunderstood your objection, which is correct:
If the eval return was effective in the foo() call, should have printed "baz".$ perl -Mstrict -we'sub bar {"baz"} sub foo {eval{return bar() || die} +; "quux"} print foo()' quux$
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: looking for a good idiom: return this if this is true
by borisz (Canon) on Mar 05, 2005 at 18:49 UTC |