[Classiccity-pm] Re: perl curiosity..

Mark Plaksin happy at mcplaksin.org
Thu Aug 5 10:03:34 CDT 2004


Paul Keck <pkeck at uga.edu> writes:

> On Thu, Aug 05, 2004 at 10:29:29AM -0400, Darrell Golliher wrote:
>> 
>>   So I'm reading someone elses code and come acrosse something like
>>   this..
>> 
>>     @things = qw(one two three);
>>     print $things[-1];
>
> print $things[$#things];

There's
print $things[@things-1];

or
print (reverse(@things))[0];

:)


More information about the Classiccity-pm mailing list