Keep It Simple, Stupid | |
PerlMonks |
Re^3: Control Flow - Multiple returns or nested conditionalsby Marshall (Canon) |
on Oct 08, 2010 at 04:40 UTC ( [id://864139]=note: print w/replies, xml ) | Need Help?? |
I posted some code earlier today at Re: Checking contents of array against contents of a hash. There is a subroutine, is_array_subset() which contains 2 return() statements. I am curious as to how your colleague would code this sub? I used less than 10 lines of code (I don't count curly braces or blank lines as lines of code). I actually added the "@extra" feature after doing the main part - and having multiple returns made that easier to do.
In Section
Seekers of Perl Wisdom
|
|