Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^2: new keyword "size" to avoid scalar trap ? ( scalar @array != scalar(LIST) )by LanX (Saint) |
on Dec 07, 2012 at 17:22 UTC ( [id://1007801]=note: print w/replies, xml ) | Need Help?? |
> I don't see a need for it. Honestly, did you immediately spot the problem in BUK's code? Re: Idiom to return 0 or random number of array elements UPDATE: Do you really prefer explaining goatse "op" =()= and turtle "op" @{[ ]} to newbes who simply need to count the elements a function returns? UPDATE: > I'd rather see them overload length to accept a hash, array or reference to a hash or array. Then it's quite impossible to tell what length ($str) is supposed to return. 1 for the list-size or the char-size of $str?
Cheers Rolf
In Section
Meditations
|
|