#!/usr/bin/perl my $HN = `hostname`; my $hosts =`cat /etc/hosts`; if ( $hosts =~ /^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)\s+(${$HN})\s/g ) { print "$1\n"; print "$2\n"; }