in reply to Re: Perl with a Samba mount
in thread Perl with a Samba mount
my $list_file=$ARGV[0]; my $outdir=$ARGV[1]; my $file_name; my $text; open LIST,$list_file; chomp(my $path=<LIST>); while($file_name=<LIST>) { chomp $file_name; local $/=undef; open INFILE,catfile($path,$file_name); $text=<INFILE> close INFILE; my $string=function1($text); function2($text); my $bindex=index($text,"<XML_TAG>"); $text=substr($text,0,$bindex). "<XML_TAG>\n". $string."\n". "</XML_TAG>\n". substr($text,$bindex); open OUT,'>'.catfile($outdir,$file_name); print OUT $text; close OUT; }
|
|---|