Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

new keyword "size" to avoid scalar trap ? ( scalar @array != scalar(LIST) )

by LanX (Chancellor)
on Dec 07, 2012 at 16:40 UTC ( #1007787=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    size @a := scalar @a;
    
  2. or download this
    size (a..c) := scalar @{[a..c]}
    
  3. or download this
    sub size([@$];@) {
    ...
    }