in reply to Deleting Duplicates in an array

First USE STRICT!!!

Having said that, let's try again:

use strict; use IO::File; my $owo = IO::File->new('owo.txt') or die "no open $!"; my %hash = (); my @list = (); # updated, i was on crack or something - i actually said # to localize $/ to slurp the contents into an array . . . DOH! my @ary = <$owo>; foreach my $item (@ary) { push(@list,$item) unless $hash{$item}++; } print join("\n", @list), "\n";
and that's it!

Second pointer, i like IO::File, you don't have to use it, but if you like OO style, i highly recommend it.

Third, go buy The Cookbook . . . that's where i learned to do this. :)

Jeff

R-R-R--R-R-R--R-R-R--R-R-R--R-R-R--
L-L--L-L--L-L--L-L--L-L--L-L--L-L--