in reply to Trying to slice off all array elements but the last one
The $#$arrayref gets the index of the last element, and you subtract 2 from that to get the index of the third to last element (the last one you want). Update: Mis-read the OP as all except last 2 elements. Fixed.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Trying to slice off all array elements but the last one
by talexb (Chancellor) on Feb 16, 2004 at 21:04 UTC |