print if !/cr\d$/ && $_ = (split)[3]; #### if (!/cr\d$/ && s/^confederation-as-router:\W+\d\W+\d\W//) { ... } #### if (!/cr\d$/ && ($host, $last) = (split)[0,3]) { print $last if $host eq 'confederation-as-router:'; }