my %hash=(); while(<>) { if (/Net '(\w+)'/){$hash{$1} = 1;} } print "$_\n" for keys %hash;