http://qs321.pair.com?node_id=160795


in reply to undef'ing @arrays caveat

I couldn't believe what I saw at first. I just spotted a similar 'bug' in my code where one of my subroutines would return 'undef' in an array assignment statement.

This is why it is generally recommended that subroutines should use return with no arguments when the intent is to return a false value --- in scalar context it returns undef, in list context it returns an empty list.