Help for this page
perl -npi.bak -e "s:([\w\d]+\.data):testname/$1:g" infile
use strict; $testname="replacement"; ... close IN; close OUT;