http://www.perlmonks.org?node_id=1012938


in reply to print out the values from a hash

This is how I would do it. The main changes were:
#!/usr/bin/perl use warnings; use strict; my %cnt; for my $file (glob '*.abc') { open my $FILE, '<', "$file" or die "$!"; for my $line (grep / FREQ /, <$FILE>) { $line =~ s/ is begin.*//; $line =~ s/.* FREQ/FREQ/; chomp($line); $cnt{$file}{$line}++; } } for my $file ( keys %cnt) { for my $line ( keys %{ $cnt{$file} } ) { print "$file $line $cnt{$file}{$line}\n"; } }
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ