Update:
My appreciation goes to idsfa and zengargoyle. I appreciate their research and their scientific and serious way of thinking.
It turned out that Java and Perl does the same, see idsfa's post for detail. Also see posts from both of them for some useful RFC's.
Original:
I have used IO::Socket::INET for a long time, but last week I suddenly noticed something: Perl always resolves localhost to loopback 127.0.0.1, which is the least expected to me.
When my computer is connected to a network, I expect localhost being resolved to my IP address assigned (in the simplest case, let's don't talk about what if my computer has multiple IP assigned), not the loopback. That is true to quite a few of other languages.
Java does it in a very interesting way, it resolves localhost to your IP address, but when you run from applet, it resolves to loopback for security reason (which is quite stupid, as I have a way to break this anyway.)
Any way, what is the reasoning behind Perl? or just a bug?
In reply to Does Perl always resolve localhost to loopback? by pg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |