Help for this page

Select Code to Download


  1. or download this
    while (<DATA>) {
       my ($host, $domain, $test) = /^([^,.]+)(,[^.]+|)\.(.+)$/;
    ...
       $domain = '' if /\.net$/;
       print("Host:$host$domain Test:$test\n");
    }
    
  2. or download this
    while (<DATA>) {
       chomp;
    ...
       $host =~ s/\..*\.net$//;
       print("Host:$host Test:$test\n");
    }
    
  3. or download this
    
    use strict;
    ...
    hosta-mel-au-1,my-domain,net.testdef
    hostxyz.testabc
    someotherhost.someothertest