#!/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"; } }
In reply to Re: print out the values from a hash
by choroba
in thread print out the values from a hash
by gibsonca
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |