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!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Is using $#array Frowned on?
by shmem (Chancellor) on Feb 13, 2014 at 20:54 UTC | |
by Kenosis (Priest) on Feb 13, 2014 at 21:00 UTC | |
|
Re: Is using $#array Frowned on?
by Kenosis (Priest) on Feb 13, 2014 at 20:48 UTC | |
|
Re: Is using $#array Frowned on?
by choroba (Cardinal) on Feb 13, 2014 at 21:32 UTC | |
|
Re: Is using $#array Frowned on?
by toolic (Bishop) on Feb 13, 2014 at 20:57 UTC | |
|
Re: Is using $#array Frowned on?
by eyepopslikeamosquito (Archbishop) on Feb 14, 2014 at 21:06 UTC |