open(FD,"+< named.conf"); $domain="domain.com"; while() { if (/^zone \"$domain\" \{/ .. /\}\;/) { print; #show me that config block } } close(FD);