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

Re: Number notation

by srawls (Friar)
on Jun 20, 2001 at 22:15 UTC ( #90118=note: print w/ replies, xml ) Need Help??


in reply to Number notation

because 2 == 02 is in numeric context. $array{$var2} is in string context. Just add int to the code like such:

print $array{int($var2)}

The 15 year old, freshman programmer,
Stephen Rawls


Comment on Re: Number notation
Select or Download Code
Re: Re: Number notation
by Michalis (Pilgrim) on Jun 21, 2001 at 00:41 UTC
    Thanks, the usage of int() is a solution, and probably the one I'll follow (although, the hash is so small that i'ld be probably better to just add the extra keys :-)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2015-07-02 01:46 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 (25 votes), past polls