while ( ) { chomp; if ($_ > 5) { $hash{ $_ }++; next; } print; }