Hi guys,

I am decoding my TAPs with Tap3edit. I introduce my input file in the Perl code and have the decoded file as an output. Now I have about 200 files I want my Perl code decode them automatically and save them as different outputs with the same name in XML. I found glob and basename for finding my specific file names in which their name starts with DA and then start to decode but in the result, it seems only the first file has been decoded. I really appreciate it if anyone can help me. I apologize if it too basic, cause I am so new with Perl.

#!/usr/bin/perl -w use strict; use warnings; use Data::Dumper; use XML::Dumper; use TAP3::Tap3edit; $Data::Dumper::Indent=1; $Data::Dumper::Useqq=1; my $dump = new XML::Dumper; use File::Basename; my $perl=''; my $xml=''; my $tap3 = TAP3::Tap3edit->new(); foreach my $file(glob 'Taps/X*') { $files= basename($file); $tap3->decode($files) || die $tap3->error; } my $filename="Out.xml"; $perl = $tap3->structure; $dump->pl2xml($perl, $filename); print "Done \n";

In reply to Run a perl code on all input files and have the results in different output files by SaraMirabi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.