$ cat > pm_1075438_1.txt qw a>sd pm_1075438_2.txt 123> <456 $ gzip pm_1075438_2.txt #### #!/usr/bin/env perl use strict; use warnings; my %h; ++$h{$_} for map { chomp; $_ } `zcat @{[glob '*.gz']} | sed 's/[<> ]//g'`; use Data::Dump; dd \%h; #### { 123456 => 1, asdfgh => 1, qwerty => 1, zxcvbn => 1 } #### ++$h{$_} for map { chomp; s/[<> ]//g; $_ } `zcat @{[glob '*.gz']}`;