#!/usr/bin/perl -w use strict; my %d = map{ #cleanup the line chomp; #does it match /^([\d\.]+) \w+/ ? ($1, $_) : (); }map{ #use @ARGV and <> magic to #read in each line from each file. local @ARGV = ($_); <>; }; #glob in all files that match open(OUTPUT, ">unique.dat") or die "a horrible death... $!"; print OUTPUT, $d{$_}."\n" for(sort keys %d); close OUTPUT;