Problems? Is your data what you think it is? | |
PerlMonks |
Re^2: new keyword "size" to avoid scalar trap ? ( scalar @array != scalar(LIST) )by LanX (Saint) |
on Dec 07, 2012 at 17:04 UTC ( [id://1007795]=note: print w/replies, xml ) | Need Help?? |
hmm good point... you are forcing everything into an array, maybe is easier to read. it's like explicitly wrapping lists and arrays into scalar @{[ ... ]} But w/o prototypes this would mean to copy huge arrays around... And something like size %hash couldn't be extended to find scalar keys %hash. Anyway your example fits as a proof of concept! =) (But an efficient implementation should be done in XS. Edit: see benchmark)
Cheers Rolf
In Section
Meditations
|
|