package SybaseInterfaces; .... my %lookup_iptoname = (); sub syb_gethostbyaddr { my $self = shift; my $class = ref($self); my ($my_ipaddr) = @_; # We cache the name lookups to increase performance and reduce network i/o unless (defined $SybaseInterfaces::lookup_iptoname{$my_ipaddr}) { $SybaseInterfaces::lookup_iptoname{$my_ipaddr} = gethostbyaddr(inet_aton($my_ipaddr), AF_INET); } return ( $SybaseInterfaces::lookup_iptoname{$my_ipaddr} ); }