Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: deleting a non-numeric scalar within array

by Generoso (Vicar)
on Dec 02, 2010 at 21:16 UTC ( #875007=note: print w/ replies, xml ) Need Help??


in reply to deleting a non-numeric scalar within array

Have you tested tried the grep function and instead of looking for the ones to delete look for the ones to keep?

 @hosts = grep !/($ARGV[0])/,@hosts;


Comment on Re: deleting a non-numeric scalar within array
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2014-07-30 03:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls