On Tue, 2008-10-21 at 22:47 +0800, Jeff Pang wrote:
> 2008/10/21 Chas. Owens <[EMAIL PROTECTED]>:
>
> >
> > This is an odd desire; are you sure you really need to do this? Can
> > you tell us what you are trying to achieve? Jeff's answer does what
> > you want, but most likely there is a better approach to be using for
> > your actual problem.
> >
>
> Agree.
> He probably want the last element from the array, then try,
> my $last = $list[-1];
if( @list ){
my $last_item = pop @list;
for my $item ( @list ){
# do stuff for all items but last
}
# do stuff for $last_item
}
--
Just my 0.00000002 million dollars worth,
Shawn
Linux is obsolete.
-- Andrew Tanenbaum
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/