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