my $filename="Taps/Output.xml";
my $fh;
open($fh, '>:encoding(UTF-8)', $filename) or die "file, $!";
foreach my $file(glob 'Taps/DA*')
{
my $tap3 = TAP3::Tap3edit->new();
$files= basename($file); #<< are you sure this is needed/does it wo
+rk?
$tap3->decode($files) || die $tap3->error;
print $fh $dump->pl2xml($tap3->structure);
}
close $fh;
WARNING: This code reads just ONE tap file, decodes it and dumps it. It does that for all TAP files. Separately. I am not sure you will get correct output, because I am not sure you want to read and decode all files first or decode and dump each separately, as above code does. |