dramguy has asked for the wisdom of the Perl Monks concerning the following question:
#!/opt/perl/5.8.7-32bit/bin/perl my $inFile = $ARGV[0]; my %CALHASH; my @CALARR; if(!$ARGV[0]) {exit;} open(FH, "<$inFile"); foreach $line (<FH>) { chomp($line); #remove newline from end of line if($line =~ /(\w+_meas_.*)/) { ##($layer, $enc) = split(' ', $1); $layer = $1; #print "$layer, $enc\n"; if (exists $CALHASH{$layer}) { $CALHASH{$layer}{'freq'}++; } else { $CALHASH{$layer}{'freq'} = 1; } } } foreach $key (keys %CALHASH) { print "$CALHASH{$key}{'freq'} $key\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Out of memory!!??
by naikonta (Curate) on May 25, 2007 at 15:12 UTC | |
by dramguy (Novice) on May 25, 2007 at 17:22 UTC | |
|
Re: Out of memory!!??
by salva (Canon) on May 25, 2007 at 15:25 UTC | |
|
Re: Out of memory!!??
by derby (Abbot) on May 25, 2007 at 15:01 UTC | |
|
Re: Out of memory!!??
by jettero (Monsignor) on May 25, 2007 at 15:02 UTC | |
|
Re: Out of memory!!??
by zentara (Cardinal) on May 25, 2007 at 15:07 UTC | |
by blazar (Canon) on May 25, 2007 at 15:34 UTC | |
|
Re: Out of memory!!??
by cengineer (Pilgrim) on May 25, 2007 at 16:23 UTC | |
|
Re: Out of memory!!??
by moritz (Cardinal) on May 27, 2007 at 08:15 UTC |