Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: (zdog) Re: Finding Redundant values in arrays

by tomhukins (Curate)
on Jun 08, 2001 at 00:06 UTC ( #86714=note: print w/ replies, xml ) Need Help??


in reply to (zdog) Re: Finding Redundant values in arrays
in thread Finding Redundant values in arrays

This won't work. The for (@test) line iterates through each element of @test, but then you skip each element with the grep you're using. In English you're saying: for each element in the array, only keep that element if it is not in the array.

Also, there is no need to place quotes round $_.

Update: This is wrong. dvergin explains what really happens in Re: (zdog) Re: Finding Redundant values in arrays.


Comment on Re: (zdog) Re: Finding Redundant values in arrays
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (13)
As of 2015-07-01 20:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (19 votes), past polls