[ic] gethostbyaddr in ic pages, how ?

Mike Heins mike at perusion.com
Fri Sep 24 16:14:51 EDT 2004


Quoting Niels Svennekj?r (linux at post10.tele.dk):
> Hi
> 
> For debugging purposes I would like to get a hostname (from an ip) on a 
> ic page
> 
> I have tryed following (with an lot of variations over "use Socket", 
> Socket:.....)
> 
> [perl]
> $hostip="1.2.3.4";
> return(gethostbyaddr(Socket::inet_aton($hostip),Socket::AF_INET) );
> [/perl]
> 
> But it alvays gives an error, like
> - Safe: 'gethostbyaddr' trapped by operation
> - Undefined subroutine &Socket::inet_aton
> - "use" not allowed in expression
> 
> If I want to make an 'lookup' of the hostname. Do I have to make an 
> usertag to do it ?

you can do with global usertag, of course, but you can also set

  hostnamelookups  yes

in interchange.cfg, and then it is available in 

	$Session->{host} or [data session host]

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.765.647.1295  tollfree 800-949-1889 <mike at perusion.com>

p.s. sorry for lower case, injured hand

If you think nobody cares if you're alive, try missing a couple of
car payments.  -- Earl Wilson


More information about the interchange-users mailing list