Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Grep question

by hok_si_la (Curate)
on Feb 03, 2005 at 18:12 UTC ( [id://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,
hok_si_la

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?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://427752]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-25 09:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found