in reply to Re: Re: html->perl->c->perl...... work dang it
in thread html->perl->c->perl...... work dang it
If an array is empty, ($#ARRAY == 0) is false. $#ARRAY is -1 for an empty array, because $#ARRAY returns the index of the last valid element, not the number of elements in the array. An array with one element has a last element of index zero.
You can do your check for an empty argument list with any of the following: (not @ARGV), (0 == @ARGV), or ($#ARGV < 0). I prefer the first, but it's a matter of style.
--
[ e d @ h a l l e y . c c ]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: html->perl->c->perl...... work dang it
by Anonymous Monk on May 15, 2003 at 17:59 UTC |