Subject: Re: Missing Lib?
To: None <tom@fundy.ca>
From: Patrick Welche <prlw1@cam.ac.uk>
List: current-users
Date: 09/19/1997 16:17:12
tom@pop.fundy.ca wrote:
>
> I have been playing with a file from the perl FAQ,
> http://www.perl.com/CPAN-local/doc/FMTEYEWTK/IPC/udp.html
> and while it runs fine on one machine (same version of perl) it
> produces this error on others. I can't find any modules that I am
> missing.
>
> Any suggestions?
>
> firestorm% ./hyb2
> Useless use of gethostbyname in void context
> at /usr/local/lib/perl5/Sys/Hostname.pm line 42.
> localhost 0 Fri Sep 19 09:12:32 1997
>
> firestorm% uname -a
> NetBSD firestorm.fundy.ca 1.2G NetBSD 1.2G (FIRESTORM) #4: Mon Sep 8
> 19:31:43 A DT 1997
>
> perl -v
>
> This is perl, version 5.003 with EMBED
> built under netbsd at Mar 17 1997 11:57:57
> + suidperl security patch
>
> Copyright 1987-1996, Larry Wall
Beginning of http://www.perl.com/CPAN-local/doc/FMTEYEWTK/IPC/udp.html :
#!/usr/bin/perl -w
use strict;
require 5.002;
use Socket;
[*] use Sys::Hostname;
my ( $count, $hisiaddr, $hispaddr, $histime,
$host, $iaddr, $paddr, $port, $proto,
$rin, $rout, $rtime, $SECS_of_70_YEARS);
[*]: use package which is correctly found as
/usr/local/lib/perl5/Sys/Hostname.pm.
In my version, Hostname.pm looks like:
34 sub hostname {
35
36 # method 1 - we already know it
37 return $host if defined $host;
38
39 if ($^O eq 'VMS') {
40
41 # method 2 - no sockets ==> return DECnet node name
42 eval {my($test) = gethostbyname('me')}; # returns 'me' on most syste
ms
43 if ($@) { return $host = $ENV{'SYS$NODE'}; }
44
Is that what yours says? What is the programme meant to do?
Cheers,
Patrick