>>>>> "sw" == shawn wilson <[email protected]> writes:
sw> I dig what you're saying about always using return. However I
sw> don't (have never used / seen) a case where a sub returns last
sw> expression. An example maybe?
the classic case which is used in the constant pragma is:
sub FOO() { 'foo' }
the last (and only) expression is returned. the () make it a prototype
with no args so it will reduce to the constant value at compile time.
it is mostly when you see stuff like this:
sub foo {
# code here
$stuff ;
}
$stuff is returned if it falls through to the that line. simple.
as i said don't do that unless it is a special case. use explicit return
statements.
uri
--
Uri Guttman ------ [email protected] -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/