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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |