in reply to Removing duplicate lines from a file
Much better, but you should also learn about perltidy :). You should start all your scripts with:
this will help you to catch errors like this:use warnings; use strict;
note softed here. Also you can writeif ($index == scalar(@softed)){
instead ofunless ($prev eq $line){ push (@filtered,$prev); }
if ($prev eq $line) { } else { push (@filtered,$prev); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Removing duplicate lines from a file
by johngg (Canon) on Jan 19, 2009 at 23:46 UTC | |
|
Re^2: Removing duplicate lines from a file
by jethro (Monsignor) on Jan 19, 2009 at 22:53 UTC |