in reply to Find and Replace

Didn't actually get what do you want, but here's the code that assigns new value to line 6:

use strict; use warnings; my $fileName = shift; #open the file and copy to an array open my $fh, "<", $fileName or die "Cannot Open File: $!"; my @aFile = <$fh>; close $fh; # use $aFile[-1] for the last line, and $aFile[5] for the 6th line $aFile[5] = qq(<xxxx.xxx.xxx.xxx, "xxx", xx_$fileName, xxx="">);