I have managed to get a workround by calling the parser from another program which feeds it one file at a time:
#! /usr/bin/perl
use strict;
use warnings;
use Fcntl;
use Getopt::Long;
use POSIX;
my ($xmlfile, $ctlfile, $config);
my @xmlfiles;
### HANDLE COMMAND LINE OPTIONS
GetOptions('config|c=s' => \$config,
'ctlfile|ctl=s' => \$ctlfile,
'xmlfile|x=s' => \$xmlfile,);
if ($xmlfile) # xmlfile specified on cmd line
{
($xmlfile = $1) = $xmlfile =~ /^(\w+\.*\w+)$/i;
push @xmlfiles, $xmlfile;
}
elsif ($config) # xmlfiles in config file
{
sysopen(XMLFILES, $config, O_RDONLY)
or die "Can't open $config : $!";
my @config = <XMLFILES>;
foreach my $line (@config)
{
next if (($line =~ /^#+/) || ($line =~ /^\s+$/)) ;
chomp($line);
push @xmlfiles, $line;
}
close XMLFILES;
}
else # try default filename then bale out
{
$xmlfile = "multimers.pisa", if (-e "multimers.pisa" and -s "multi
+mers.pisa");
if ($xmlfile)
{
print "Using default xml file $xmlfile\n";
($xmlfile = $1) = $xmlfile =~ /^(\w+\.*\w+)$/i;
push @xmlfiles, $xmlfile;
}
else
{
die "No valid xmlfile specified...exiting\n";
}
}
foreach my $file (@xmlfiles)
{
system "xml_pisa.pl $file"; # this calls the original
+
# twig parsing script
}
|