Okay, i'll take my armor and my shield, and no axes (today i'm friendly)
#!/usr/bin/perl use strict; use Digest::MD5 qw(md5); my %line; while (<>) { my $digest = md5($_); unless ( exists $line{$digest} and $line{$digest} == length ) +{ $line{$digest} = length; print; } }
Last of all, its nice to receive constructive critics ...
turo
PS: thanks for the abbreviation (sort -u file) i didn't knew it :-)
In reply to Re^3: Deleting duplicate lines from file
by turo
in thread Deleting duplicate lines from file
by Win
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |