Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: `hostname -s`

by keszler (Priest)
on Nov 28, 2011 at 19:47 UTC ( #940454=note: print w/ replies, xml ) Need Help??


in reply to `hostname -s`

$HOSTNAME = `hostname -s`;

$HOSTNAME includes "\n". Chomp it.

Update: Here's a way to see what's happening:

prompt$ perl -e '$HOSTNAME = `hostname -s`; print $HOSTNAME;' | od -c


Comment on Re: `hostname -s`
Select or Download Code
Replies are listed 'Best First'.
Re^2: `hostname -s`
by joeymac (Acolyte) on Nov 28, 2011 at 20:12 UTC

    Ah! Yes of course! I tried out the update you included. That is interesting that it includes the "\n". I fixed the code

    chomp($HOSTNAME = `hostname -s`);

    and it works great now! Tried it on all three servers and it was successful. I'm going now to relay the fix to my coworker. Thanks for your help!

    Joe

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2015-08-28 00:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (334 votes), past polls