Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: using hashes

by AnomalousMonk (Monsignor)
on Sep 26, 2013 at 16:17 UTC ( #1055860=note: print w/ replies, xml ) Need Help??


in reply to Re^2: using hashes
in thread iterating hash keys?

... am I missing something?

You're missing what BrowserUk said here, an approach that processes an entire line at a time.

The next part to think about is what happens if you encounter a 'word' in a line that doesn't exist in your translation hash, e.g., the line
    "peaches,peaches,foobar,kiwis\n"
(hints: exists, next, maybe  // (defined-or) or  ?: (ternary/conditional operator) – see perlop for the latter two).


Comment on Re^3: using hashes
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2014-07-28 10:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (196 votes), past polls