in reply to Re: Perl with a Samba mount
in thread Perl with a Samba mount

Here is some code. Both the input and output directories are on the samba mount. Functions 1 and 2 do some string manipulation, but don't touch the file system. The $list_file is a file that starts with a path to a directory and then is a list of files. Thank you for your input.
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; }