in reply to I don't understand error message
A sub in scalar context (as is the case here) cannot do anything but return a value. (It crashes Perl when they don't.)
- People for the equitable treatment of undef