http://www.perlmonks.org?node_id=864139


in reply to Re^2: Control Flow - Multiple returns or nested conditionals
in thread Control Flow - Multiple returns or nested conditionals

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.

  • Comment on Re^3: Control Flow - Multiple returns or nested conditionals