No such thing as a small change | |
PerlMonks |
Re: `hostname -s`by graff (Chancellor) |
on Nov 29, 2011 at 00:26 UTC ( [id://940495]=note: print w/replies, xml ) | Need Help?? |
Apart from using the Sys::Hostname module as recommended by Corion, you could also check to see whether the shell environment in which perl is operating contains a "HOST" variable already set for you:
That works for me when running on a linux (debian) desktop machine (but not on a macosx 10.7 laptop). For the sake of portability, I'd go with the module.
In Section
Seekers of Perl Wisdom
|
|