open(my $fh, $namefile) or die "$namefile: $!"; while (<$fh>) { rename ($_, "testfile$_") or warn "rname $_: $!"; } close($fh);