Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^2: Grep question

by hok_si_la (Curate)
on Feb 03, 2005 at 18:12 UTC ( #427752=note: print w/replies, xml ) Need Help??

in reply to Re: Grep question
in thread Grep question

Thanks all of you. I have made the suggested changes. I will need to look at them more in depth.

I have a similar question for those of you with patience. I am trying to remove an item from an array using the delete function. Here is the code:
@statusoption = ('Waiting Approval' , 'Denied' , 'Approved' , 'Ordered +' , 'Building' , 'Built' , 'Shipped'); delete $statusoption[3];
This simply yields ('Waiting Approval' , 'Denied' , 'Approved' , '' , 'Building' , 'Built' , 'Shipped')
I would like to remove 'Ordered' from the array and shift all the other elements down an index truncating the array by 1.

I appreciate you help,

Replies are listed 'Best First'.
Re^3: Grep question
by Roy Johnson (Monsignor) on Feb 03, 2005 at 18:19 UTC
    That's what splice is for:
    splice(@statusoption, 3, 1);

    Caution: Contents may have been coded under pressure.
      Ahhhhhhh! Thanks, you have been most helpful. Have a good super bowl weekend if you are in to that kind of thing.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://427752]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2018-04-24 23:14 GMT
Find Nodes?
    Voting Booth?