Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: gethostbyname: What does $aliases look like?

by ikegami (Patriarch)
on Sep 14, 2009 at 06:58 UTC ( [id://795069]=note: print w/replies, xml ) Need Help??


in reply to gethostbyname: What does $aliases look like?

An array of strings, I would suppose, like the system call.

Then again, Perl doesn't return an array when there's only one alias. Maybe it returns one at most?

$ perl -MData::Dumper -e'print Dumper $_ for (gethostbyname $ARGV[0])[ +0,1]' www.google.com $VAR1 = 'www.l.google.com'; $VAR1 = 'www.google.com';

Update: They are space-joined. From pp_sys.c:

PUSHs(space_join_names_mortal(hent->h_aliases));

Replies are listed 'Best First'.
Re^2: gethostbyname: What does $aliases look like?
by Skeeve (Parson) on Sep 14, 2009 at 07:12 UTC
    Thanks, ikegami

    s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
    +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2024-04-26 05:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found