viktor has asked for the wisdom of the Perl Monks concerning the following question:
Dear monks , I have written a script which selects the data till the line matches ======== then take that data in an array and execute a system command. The command has a default ouputfile in which the analysis is done and written. But my script overwrites the earlier data. Means the code is correct only thing is that I am overwriting the data in the ouput file which is being generated by the software which I am using by system command . How I can avoid that .
#!/usr/bin/perl -w use strict; my @aln; open(FILE,"vik.fna"); while (my $line = <FILE>) { if ($line !~ /^==========/) { push (@aln, $line); } else { open (SEQFILE, ">vik.tmp"); print SEQFILE join("",@aln); close SEQFILE; @aln = (); system("java -jar BMGE.jar -i vik.tmp -t AA -o tmsa.out") +; } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: using the system command
by AnomalousMonk (Archbishop) on Jul 01, 2011 at 12:11 UTC | |
Re: using the system command
by moritz (Cardinal) on Jul 01, 2011 at 10:55 UTC | |
by viktor (Acolyte) on Jul 01, 2011 at 11:00 UTC | |
by roboticus (Chancellor) on Jul 01, 2011 at 11:46 UTC | |
by moritz (Cardinal) on Jul 01, 2011 at 11:11 UTC | |
Re: using the system command
by Anonymous Monk on Jul 01, 2011 at 10:57 UTC | |
Re: using the system command
by rev_1318 (Chaplain) on Jul 01, 2011 at 15:13 UTC |
Back to
Seekers of Perl Wisdom