This is my file lvtnfet cmos20lpm lvtnfet_b symbol d g s b PROPMAP m=m And this would be my output file lvtnfet_float cmos20lpm lvtnfet_b symbol d g s b PROPMAP m=m lvtnfet_auxpc2 cmos20lpm lvtnfet_b symbol d g s b PROPMAP m=m #### #!/tool/pandora/.package/perl-5.12.1/libexec/perl5.12.1 -w use strict; use warnings; my $file="device.map"; open (FH, "< $file") || die "Could not open file: $!\n"; my @lines = ; close(FH); open (FH, "> $file"); for (@lines){ if ($_=~m/lvtnfet cmos20lpm lvtnfet_b symbol d g s b PROPMAP m=m/) print FH "lvtnfet_float cmos20lpm lvtnfet_b symbol d g s b PROPMAP m=m \n"; print FH "lvtnfet_auxpc2 cmos20lpm lvtnfet_b symbol d g s b PROPMAP m=m \n"; } print FH close FH; print "done\n"; #### Bareword found where operator expected at device.map line 4, near "// GLOBALFOUNDRIES" (Missing operator before GLOBALFOUNDRIES?) Bareword found where operator expected at device.map line 6, near "// except" (Missing operator before except?) Bareword found where operator expected at device.map line 47, near "m=m AREA=area" Bareword found where operator expected at device.map line 48, near "m=m AREA=area"