Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^4: Reading through a file and checking for a specific string

by poj (Priest)
on Aug 20, 2013 at 17:41 UTC ( #1050217=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Reading through a file and checking for a specific string
in thread Reading through a file and checking for a specific string

Store the description in a hash not an array.

#!/usr/bin/perl use strict; # test data my %counts = ( AB => 135172, AC => 0, AD => 64, AE => 0, FG => 248782, ); my %descr = ( AB => 'ABYUSID', FG => 'FGIUIO', AD => 'ADHGUT', AE => 'AERUTOT', AC => 'ACVHGTI', ); for my $type ( sort keys %counts ) { # add sort next if ($counts{$type} == 0); # skip zeros print "$type($descr{$type})\t: $counts{$type}\n"; # add descr }
poj


Comment on Re^4: Reading through a file and checking for a specific string
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1050217]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2015-07-06 02:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (69 votes), past polls