luckysing has asked for the wisdom of the Perl Monks concerning the following question:
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 }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: call multiple perl scripts from within a perl scripts ?
by BrowserUk (Patriarch) on Aug 03, 2010 at 23:57 UTC | |
by luckysing (Novice) on Aug 04, 2010 at 21:27 UTC | |
|
Re: call multiple perl scripts from within a perl scripts ?
by cdarke (Prior) on Aug 04, 2010 at 06:14 UTC | |
by luckysing (Novice) on Aug 04, 2010 at 21:28 UTC | |
|
Re: call multiple perl scripts from within a perl scripts ?
by ahmad (Hermit) on Aug 04, 2010 at 01:25 UTC | |
by Anonymous Monk on Aug 04, 2010 at 21:38 UTC |