#-*-perl-*- # # Copyright (c) 1997 Kevin Johnson . # # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl # itself. # # $Id: Utils.pm,v 1.1 1997/03/30 01:55:36 kjj Exp $ require 5.003; use strict; use Carp; use Exporter; use vars qw($VERSION @ISA @EXPORT_OK); $VERSION = '0.01'; @ISA = qw(Exporter); @EXPORT_OK = qw(valid_domain valid_ip valid_netmask); =head1 NAME Net::Bind::Utils - various routines common across Net::Bind packages. =head1 DESCRIPTION A catch-all place for various routines that useful across most, if not all, of the C interfaces. This module is not designed to be subclassable. =head1 ROUTINES =head2 valid_domain($domain) Returns C<1> if the given C<$domain> string is defined and is a valid rfc1035 domain name, otherwise returns C<0>. =cut sub valid_domain { my $domain = shift; return 0 unless defined($domain); # from RFC1035: # ::= | " " # ::=