ICh has asked for the wisdom of the Perl Monks concerning the following question:

Hi, everybody!

I tried to study the Net::Jabber module; unfortunatelly, the example rpc_client.pl died:

Cannot resolve linux-cf8p: at /usr/lib/perl5/vendor_perl/5.20.1/XML/Stream.pm line 409

This name is the name of my computer. The line reads:

my $address = gethostbyname($hostname) || die("Cannot resolve $hostname: $!");

Therefore, the built-in gethostbyname cannot resolve the real name of my computer.

No idea what to do.

Thanks a lot.

Replies are listed 'Best First'.
Re: Net::Jabber module, problem
by Anonymous Monk on May 21, 2015 at 06:39 UTC
    So what do you get when you run    perl -MData::Dump -e"dd( gethostbyname(q{localhost}) )"
      Thanks for your answer.  perl -MData::Dump -e"dd( gethostbyname(q{localhost}) )" gives

      ("localhost", "", 2, 4, "\x7F\0\0\1")

Re: Net::Jabber module, problem
by ICh (Initiate) on May 22, 2015 at 08:26 UTC
    Solved the problem: added the name to the /etc/hosts

    Thanks!