good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^2: Perl text processingby AnomalousMonk (Archbishop) |
on Jun 09, 2014 at 17:14 UTC ( [id://1089292]=note: print w/replies, xml ) | Need Help?? |
Some untested thoughts: open (...); Return status of open statements not checked; alternately, use autodie; not used. $devices{$1}=0 if /^\s*(\d{8}$/; Capture group (\d{8}$ not closed. my $imeitag=$1 if /^\s*(\d{8}\d+\s*$/ Capture group (\d{8}\d+\s*$ not closed; statement not terminated (missing semicolon); my $imeitag ... if ... ; conditional creation of lexical (pre-state static variable hack). for my $imeitag (sort {$devices{$a}<=>$devices{$b}} keys %devices){ Sorts keys of hash in ascending numerical order, but then prints first 100 keys, which does not seem in accord with requirement to "output ... the top 100 devices" (whatever "top" may exactly mean in the context of the OP).
In Section
Seekers of Perl Wisdom
|
|