Help for this page

Select Code to Download


  1. or download this
    <domain> ::= <subdomain> | " "
    
    ...
    upper case and a through z in lower case
    
    <digit> ::= any one of the ten digits 0 through 9
    
  2. or download this
    use Net::DNS::DomainName;
    my $host = "foo.example.com";
    my $bare = (Net::DNS::DomainName->new($host)->label)[0];
    print "$bare\n";  # prints "foo"