"be consistent" | |
PerlMonks |
Is using $#array Frowned on?by doubleqq (Acolyte) |
on Feb 13, 2014 at 20:44 UTC ( [id://1074891]=perlquestion: print w/replies, xml ) | Need Help?? |
doubleqq has asked for the wisdom of the Perl Monks concerning the following question: Hi Monks, I recently used the '$#array' operator in a script with great success. However reading in the 'Programming Perl' book it says: "$#, do not use this; user printf instead". I think I might be getting my operators confused here, since I am not using the output format for printed numbers (I think). But as for finding the last index in an array, the '$#array' was invaluable. Is this practice generally considered poor form? If not recommended to use, what would be a better way? Thanks!
Back to
Seekers of Perl Wisdom
|
|