in reply to using s///g;

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?

Premature optimization is the root of all job security

Replies are listed 'Best First'.
Re^2: using s///g;
by ravi45722 (Pilgrim) on Aug 06, 2015 at 11:43 UTC
    Ya exactly its printing on the terminal correctly but the actual data not changing. But i want to change in the file also.