Hello Nathaniel,

Saturday, November 03, 2001, Wert, Nathaniel <[EMAIL PROTECTED]> wrote:

WN> Maybe it comes in the statement before that:

WN> $nodename = <STDIN>;
:) you forgot
chomp $nodename;
here. $nodename contains '\n' at the end.

WN> $iaddr = gethostbyname($nodename);
WN> ($a,$b,$c,$d) = unpack('C4',$iaddr);
WN> $ipaddress = "$a.$b.$c.$d";
WN> print $ipaddress;

WN> I have debugged this numerous times and I can't seem to understand
WN> why gethostbyname does not return anything. I have tried with both
WN> the  hostname  and  the  hostname.foo.com notation and it does not
WN> work.

WN> It  does  work  when I replace $nodename with 'node.foo.com' but I
WN> can't get the imputed variable to work?
perldoc -f chomp

Best wishes,
 Maxim                            mailto:[EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to