Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: how to avoid mis-spelling hash keys?

by perrin (Chancellor)
on Jan 05, 2003 at 21:50 UTC ( #224474=note: print w/ replies, xml ) Need Help??


in reply to how to avoid mis-spelling hash keys?

One very simple approach that works with older versions of Perl is to use lexical variables for your keys.

use strict; my $bar = 'bar'; my $foo{$bar} = 1; my $foo{$bear} = 1; # gives a compile error


Comment on Re: how to avoid mis-spelling hash keys?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2014-12-29 12:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (187 votes), past polls