What I want to do is that I have a tar file which in turn has many .tgz files inside it .i want to extract the big tar file and then for each .tgz file i want to run 4 Perl scripts.after i run these scripts i get 2 text files which are of interest to me .So if i iterate for 20 .tgz files i should get 40 .txt files in all but the problem with this code is iam getting text files for only the first run?that is i am getting only two text files from the entire process

#!/usr/bin/perl -w use strict; use Archive::Tar; my (@files,$i,$name,$ext,@filelist,@textfiles); my $tar = Archive::Tar->new(); $tar->read('some.tar'); $tar->extract(); my $tar1 = Archive::Tar->new(); @files=<*.tgz>; for $i(0..$#files) { $tar1->read("$files[$i]"); $tar1->extract(); #untar .tgz files @filelist=<*.txt>; system("perl script1.pl "); #run 4 scripts on the files and get +the data #from files system("perl script2.pl "); system("perl script3.pl "); system("perl script4.pl "); @textfiles=("file1.txt","file2.txt"); unlink @textfiles; #remove unwanted textfiles from the director +y unlink @filelist; #remove the extracted files }

In reply to call multiple perl scripts from within a perl scripts ? by luckysing

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.