in reply to Re^2: Unexpected results from a regex replacement
in thread Unexpected results from a regex replacement
Oh, while I'm looking at it, I suspect you don't actually mean s{../CLRIS/}{}g;. It seems much more likely that you mean s{\.\./CLRIS/}{}g;sub find_replace { my $filename = shift; open (my $infile, "$dir/$filename") or die "Can't open file: $!"; local $/ = undef; my $outdata = <$infile>; close $infile; $outdata =~ s{../CLRIS/}{}g; $outdata =~ s{../../menu/}{}g; $outdata =~ s{../../Images}{Images}g; $outdata =~ s{<cfmail}{<!--- <cfmail}g; $outdata =~ s{</cfmail>}{</cfmail> --->}g; open (my $outfile, "+>$dir/$filename") or die "Can't open file: $! +"; print $outfile "$outdata"; close $outfile; }
|
|---|