2 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml">
5 <title>Sys::Hostname - Try every conceivable way to get hostname
</title>
6 <meta http-equiv=
"content-type" content=
"text/html; charset=utf-8" />
7 <link rev=
"made" href=
"mailto:" />
10 <body style=
"background-color: white">
11 <table border=
"0" width=
"100%" cellspacing=
"0" cellpadding=
"3">
12 <tr><td class=
"block" style=
"background-color: #cccccc" valign=
"middle">
13 <big><strong><span class=
"block"> Sys::Hostname - Try every conceivable way to get hostname
</span></strong></big>
17 <p><a name=
"__index__"></a></p>
22 <li><a href=
"#name">NAME
</a></li>
23 <li><a href=
"#synopsis">SYNOPSIS
</a></li>
24 <li><a href=
"#description">DESCRIPTION
</a></li>
25 <li><a href=
"#author">AUTHOR
</a></li>
32 <h1><a name=
"name">NAME
</a></h1>
33 <p>Sys::Hostname - Try every conceivable way to get hostname
</p>
37 <h1><a name=
"synopsis">SYNOPSIS
</a></h1>
40 $host = hostname;
</pre>
44 <h1><a name=
"description">DESCRIPTION
</a></h1>
45 <p>Attempts several methods of getting the system hostname and
46 then caches the result. It tries the first available of the C
47 library's gethostname(),
<code>`$Config{aphostname}`
</code>, uname(
2),
48 <code>syscall(SYS_gethostname)
</code>,
<code>`hostname`
</code>,
<code>`uname -n`
</code>,
49 and the file
<em>/com/host
</em>. If all that fails it
<code>croak
</code>s.
</p>
50 <p>All NULs, returns, and newlines are removed from the result.
</p>
54 <h1><a name=
"author">AUTHOR
</a></h1>
55 <p>David Sundstrom
<<em><a href=
"mailto:sunds@asictest.sc.ti.com">sunds@asictest.sc.ti.com
</a></em>></p>
56 <p>Texas Instruments
</p>
57 <p>XS code added by Greg Bacon
<<em><a href=
"mailto:gbacon@cs.uah.edu">gbacon@cs.uah.edu
</a></em>></p>
58 <table border=
"0" width=
"100%" cellspacing=
"0" cellpadding=
"3">
59 <tr><td class=
"block" style=
"background-color: #cccccc" valign=
"middle">
60 <big><strong><span class=
"block"> Sys::Hostname - Try every conceivable way to get hostname
</span></strong></big>