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

Re^3: How do I remove the duplicates from the array?

by farang (Chaplain)
on Sep 26, 2013 at 07:09 UTC ( [id://1055790]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How do I remove the duplicates from the array?
in thread How do I remove the duplicates from the array?

In that case you can add an else block to the code generating the arrays @output and @output1 in choroba's code.

my (@output, @output1); for my $i (0 .. $#array) { if (exists $hash{ $array[$i] } and $array1[$i] == $hash{ $array[$i] }{highest}) { push @output, $array[$i]; push @output1, $array1[$i]; } else { push @output, ''; # or use spaces ' ' here push @output1, ''; # or whatever you want } }

Log In?
Username:
Password:

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

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

    No recent polls found