in reply to add a line or string in complex perl file

Hi, just try this

input 1.pl; **************** open(CFG_READ, "< txt52_mm.org") || die "Couldn't open tmp config comm +and file for reading"; open(CFG, "> txt52_mm.cfg") || die "Couldn't open config file for writ +ing"; ... ... ... ... ... open(ASM_READ, "< t52${fl}a.org") || die "Couldn't open tmp"; open(ASM, "> t52${fl}a.asm") || die "Couldn't open file for writing "; ********************** ####### perl-coding start undef $/; open(READ, "< 1.pl") ; $str = <READ>; close(READ); $str =~s#"(> )(.+?)\.(cfg|asm)"#"$1\$execdir\/$2\.$3"#gsi; open(OUT, "> 2.pl") ; print OUT $str; ####### perl-coding end ********** output 2.pl ************** open(CFG_READ, "< txt52_mm.org") || die "Couldn't open tmp config comm +and file for reading"; open(CFG, "> $execdir/txt52_mm.cfg") || die "Couldn't open config file + for writing"; ... ... ... ... ... open(ASM_READ, "< t52${fl}a.org") || die "Couldn't open tmp"; open(ASM, "> $execdir/t52${fl}a.asm") || die "Couldn't open file for w +riting "; ******************