use strict; use warnings; my $find = "20150518"; my $replace = "18 May 2015"; while (my $line = <DATA>) { $line =~ s/$find/$replace/g; print $line; } __DATA__ 20150518
Prints:
18 May 2015
as expected which leads me to think that the code you show is not the code you executed to get the error. Maybe you can modify the test code I've given to reproduce your error then show us that version?
In reply to Re: using s///g;
by GrandFather
in thread using s///g;
by ravi45722
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |