Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Preventing unintended list expansion inside hash literals. (return;)

by tye (Sage)
on Jan 07, 2017 at 19:11 UTC ( [id://1179140] : note . print w/replies, xml ) Need Help??


in reply to Preventing unintended list expansion inside hash literals.

Yep, you should change return; to return undef;. It is a very bad idea to use return; in a sub that otherwise only ever returns a single scalar.

- tye