Link to home
Start Free TrialLog in
Avatar of refr
refr

asked on

Limiting An Array

How Can I Limit An Array To The First 5 Elements?
Make This Array: @a(1,2,3,4,5,6,7)
This Array @a(1,2,3,4,5)
ASKER CERTIFIED SOLUTION
Avatar of martinag
martinag

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of refr
refr

ASKER

I Think I Need To ReDo That One.
I Need To Make An Array Using Only The Last 5 Elements Of @a.
Avatar of refr

ASKER

Adjusted points to 75
Avatar of ozo
@b=@a[-5..-1];
@b=splice(@a,-5); #if you want to remove those elements from @a

Avatar of refr

ASKER

Great.
Txs
otto