From: Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> > On Feb 20, Robert Citek said: > > > perl -e '@f=(1..10); print @f[1..$#{@f}-1], "\n"; ' > > I stay away from $#array (your $#{@f} can be just $#f). > > print @f[1 .. @f-2];
I don't agree. If you mean "the last index" (plus or minus whatever) use $#array, if you mean the number of items use scalar(@array). Even though it's very very unlikely that you will ever encounter a situation when $#array != scalar(@array) - 1 you should still not confuse the two. IMHO of course. Of course this is just a matter of personal taste :-) Like the fact that I tend to use scalar(@arrray) even if it's clear the array is in scalar context already. Just to make sure it's plain to see I meant the array length. Jenda ===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz ===== When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]