foreach my $row (@rows) { foreach my $key (keys %$row) { $tempc =""; $tempb =""; $tempa = $row->{$key}; $tempc = "href=\"$paths\""; if ( defined $tempa ) { if ($tempa =~ /$domain/) { $tempb = $1 if $tempa=~ /$domain(.*)/; } else { $tempb = $tempa; } $tempb = "href=\"$tempb\""; #print "your old $tempc is being replaced by $tempb
\n"; (my $search = $tempc) =~ s[/](\\/)g; (my $replace = $tempb) =~ s[/](\\/)g; print "search = $search and replace = $replace"; system("sed -e 's/$search/$replace/g' $File1 > $Replace_html"); } else { push ( @NotFound, $tempc ); } } } } #end of else } #end of big foreach and $search = 'href="\/spanishresources.jsp" ' and $replace = 'href="\/spanish.html"'