#! /usr/bin/perl -w $pathtofiles = "/var/named/backup/"; $pathtooutfiles = "/var/named/new/"; open ( HOSTFILES, ") { chomp ( $currFile = $_ ); $execcmd = "cat $pathtofiles$currFile | sed s/67\.105\.127/63.193.70/ > $pathtooutfiles$currFile"; system ( "$execcmd" ); print "$currFile\n"; }; close HOSTFILES;