#!/usr/bin/perl use Net::Config qw(%NetConfig); use strict; my %arr = ( snpp_hosts=>1, daytime_hosts=>1, ph_hosts=>1, time_hosts=>1, smtp_hosts=>1, nntp_hosts=>1, pop3_hosts=>1 ); foreach my $x(keys %NetConfig) { if ($arr{$x}) { print "$x=>"; print "@{$NetConfig{$x}}\n"; } else { print "$x=>$NetConfig{$x}\n"; } }