![]() |
|
Problems? Is your data what you think it is? | |
PerlMonks |
RE: I use return on a subroutineby Maclir (Curate) |
on May 29, 2000 at 01:37 UTC ( #15227=note: print w/replies, xml ) | Need Help?? |
As a matter of "good programming practice", I always state an explicit return, like "return 1;", or "return $status_code;" to make it easier for the programmers that will follow on from me.
As well, when a subroutine is performing a task with a number of tests - say a data validation exercise - having a return after each failure avoids incredible messy code.
Ken
In Section
Past Polls
|
|