|
NAMESys::Hostname::FQDN - Get the short or long hostname SYNOPSISuse Sys::Hostname::FQDN qw( asciihostinfo gethostinfo inet_ntoa inet_aton fqdn short ); $host = short(); $fqdn = fqdn(); ($name,$aliases,$addrtype,$length,@addrs)=gethostinfo(); ($name,$aliases,$addrtype,$length,@addrs)=asciihostinfo(); $dotquad = inet_ntoa($netaddr); $netaddr = inet_aton($dotquad); INSTALLATIONTo install this module type the following:perl Makefile.PL make make test make install Solaris users, see the 'hints' subdirectory if you have problems with the build. DESCRIPTIONSys::Hostname::FQDN uses the host 'C' library to discover the (usually) short host name, then uses (perl) gethostbyname to extract the real hostname.The results from gethostbyname are exported as gethostinfo and asciihostinfo as a convenience since they are available. Similarly, the 'C' library functions inet_ntoa and inet_aton are exported.
DEPENDENCIESnone EXPORTNone by default EXPORT_OKasciihostinfo gethostinfo inet_ntoa inet_aton fqdn short ACKNOWLEDGEMENTSThe workaround for systems that do not have 'inet_aton' is taken directly from Socket.xs in the Perl 5 kit for perl-5.8.0 by Larry Wall, copyright 1989-2002. Thank you Larry for making PERL possible for all of us.AUTHORMichael Robinton <michael@bizsystems.com>COPYRIGHT AND LICENCECopyright 2003-2010, Michael Robinton <michael@bizsystems.com> This module is free software; you can redistribute it and/or modify it under the terms of either: a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" which comes with this module. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the Artistic License for more details. You should have received a copy of the Artistic License with this module, in the file ARTISTIC. If not, I'll be glad to provide one. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Visit the GSP FreeBSD Man Page Interface. |