Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 perusing the Monastery: (6)
As of 2014-11-29 00:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (200 votes), past polls