Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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?

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2015-11-26 16:08 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (701 votes), past polls