Parsing/interpolation question
Ken Cornetet <[email protected]> Thu, 31 Mar 2011 11:04:31 -0400
| Newsgroups | gmane.comp.lang.perl.active-perl |
|---|---|
| Message-ID | <DF6A68E27C9C734592018E2317E9583606CDB519FD@nts532.kii.kimball.com> |
I ran into an issue creating hashes with IP addresses as a key. They don't do what you'd expect them to do (at least not what I expected). In other words, $hash{192.168.1.1} isn't the same as $hash{'192.168.1.1'}
I understand what's between the "{" and "}" is subject to interpolation, but I don't understand what perl interpolation rules apply.
What I found is that something like 192.168.1.1 seems to parsed/interpolated as chr(192) . chr(168) . chr(1) . chr(1)
I would have expected that if any interpolation were to be done on 192.168.1.1 the periods would be parsed as a string append giving the result "19216811", which coincidently, is how $x = 192 . 168 . 1 . 1 is parsed.
Is there any documentation of this behavior?
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs