$fh = IO::Zlib->new( "$file", 'rb' ) or die "Zlib failed: $!"; $count{$_}++ for map { ( split /\|/ )[3,4] } <$fh>; print Dumper(%count);