Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

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,

Comment on Re^2: Grep question
Download Code
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (11)
As of 2015-12-01 10:01 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (798 votes), past polls