I have written a perl script to modify xml file which is working fine for only one file. I want my script to fetch the xml folder and modify the xml file inside it. Like that it should run for all the xml files in the xml folders. so how can i achieve it.
Here is my code.
open(FILE, "/home/AP/abc.xml") || die "File not found";
my @lines = <FILE>;
close(FILE);
my @newlines;
foreach(@lines) {
$_ =~ s/<abc>/$&\n<!--a-->\n<!--b-->\n<!--c-->/g ;
s/hai/bye/g;
s/---/--/g;
s/***/**/g;
push(@newlines,$_);
}
open(FILE, "/home/AP/abc.xml") || die "File not found";
print FILE @newlines;
close(FILE);