Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Grep question

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


in reply to Re: Grep question
in thread Grep question

I will post the more code to give you guys a better idea of what I am trying to accomplish. I have no problem getting this to work, but I have been cleaning it up a bit. Originally it was about 40 lines, and now I have it down to this. In the process I am learning about perl Data structures.

###--- Define options for select Status ---### @statusoption = ('Waiting Approval' , 'Denied' , 'Approved' , 'Ordered +' , 'Building' , 'Built' , 'Shipped'); if ($purchase eq "Already Have") { delete @statusoption[3]; } if ($purchase eq "Virtual Machine") { delete @statusoption[3]; delete $statusoption[6]; } @statusoption = grep {$found++ if $_ eq $status; $found } @statusoptio +n; ###----------------------------------------###


Comment on Re^2: Grep question
Download Code
Re^3: Grep question
by hok_si_la (Curate) on Feb 03, 2005 at 18:23 UTC
    Actually the code is as follows
    ###--- Define options for select Status ---### @statusoption = ('Waiting Approval' , 'Denied' , 'Approved' , 'Ordered +' , 'Building' , 'Built' , 'Shipped'); if ($purchase eq "Already Have") { delete $statusoption[3]; } if ($purchase eq "Virtual Machine") { delete $statusoption[3]; delete $statusoption[6]; } @statusoption = grep {$found++ if $_ eq $status; $found } @statusoptio +n; ###----------------------------------------###

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2014-12-28 03:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (178 votes), past polls