Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: `hostname -s`

by graff (Chancellor)
on Nov 29, 2011 at 00:26 UTC ( #940495=note: print w/ replies, xml ) Need Help??


in reply to `hostname -s`

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:

perl -le 'print $ENV{HOST}'
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.


Comment on Re: `hostname -s`
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2014-12-26 23:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls