But statements (things like if, for, while) don't have values and return pretty much garbage?
Well, if works in that it returns the result of the last expression evaluated. It seems that's what looping constructs should do too. Wouldn't it make sense for this sub x { $_ for 10 } to return 10?
-sauoq "My two cents aren't worth a dime.";
In reply to Re^3: "last expression" quiz
by sauoq
in thread "last expression" quiz
by fxn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |