in reply to using s///g;
# #1137654 my $find = "20150518<"; # assumes that a date-like value not +followed by a '<' is not what you seek my $replace = "18 May 2015"; while(my $line = <DATA>) { if($line =~ $find) { # select lines to print, unless you want + all lines * Note1 s/$find/$replace/g; # UPDATE: but the slash-g is utterly unne +cessary print $line; # as it would act only on single line +s in this case } } # * Note1: acknowledged: you want all lines. (another update) =head output 20150518<114319747011000001>, 20150518<bulkbull3>, =cut __DATA__ 20150518<114319747011000001>, 20150518230002,< >, 917696706652,01, , 52727, rch,, admin,, 01,21314,, bulkpull2,, 20150518<bulkbull3>,
|
|---|