in reply to Unique array w/o repeated elements and still keep the original order!
my @lines=(); open (FILE,"$tempfile5") || die "Cannot read from $tempfile5\n"; my $found = 0; while(<FILE>){ my $line_holder = $_; #DOH, should have had this here foreach my $val(@lines){ if($val eq $line_holder){$found = 1;} } if($found){ $found = 0; next; }else{ push @lines, $line_holder; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Unique array w/o repeated elements and still keep the original order!
by jynx (Priest) on Aug 09, 2002 at 20:17 UTC | |
by TexasTess (Beadle) on Aug 09, 2002 at 20:34 UTC | |
by DamnDirtyApe (Curate) on Aug 09, 2002 at 20:46 UTC | |
by demerphq (Chancellor) on Aug 09, 2002 at 21:05 UTC | |
by jynx (Priest) on Aug 09, 2002 at 21:17 UTC | |
|