Dear Monks,
I seem to have a problem that is impossible to fix. I have one program that runs the following system call. The program containing the system call detects when an input file is submitted and proceeds with the system call.
system "perl 20_October_2004_K.pl G:/PUB_HLTH/Perl_program/DSR_calcul
+ation/20_October_2004/Input/$job G:/PUB_HLTH/Perl_program/DSR_calcula
+tion/20_October_2004/Output/$job_out";
The output file is created and specified (through convention) by the file submitter, to the above output directory.
The computer running these Perl programs is unable (for unknown reasons) to create the output file. It can only write to the output file. But I want multiple writings to the output file because the input file can contain multiple queries in the single file. The perl program 20_October_2004_K.pl won’t let me do this. It only lets me write one fetchrow_array.
The bit of code that writes to the output file is:
my $inputfile = $ARGV[0];
my $outputfile = $ARGV[1];
open (OUTPUT_FILE, "+>>", $outputfile)
or die "Unable to open $outputfile: $^E\n";
while (my @row = $sth_C->fetchrow_array) {
print OUTPUT_FILE join("\t", @row);
print OUTPUT_FILE "\n";
}
I don’t think I can solve this problem without big changes to the code. Any ideas?
In reply to System call
by Win
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.