Here's a suggestion, just to make sure you are looking at the right evidence when you say that the append operation is not working on the file (I'm also fixing your indentation a bit, and improving the error checking/reporting):
my $original_size = -s $target_full_path; # how many bytes in the fil
+e
open( my $out, ">>", $target_full_path) # I like using lexical file
+ handles, and
or die "Can't open $target_full_path: $!"; # reporting system erro
+r messages
while($fetchdata=$sth4->fetchrow_array())
{
print $fetchdata;
print $out $fetchdata or die "print to file failed: $!";
$rowcount++;
}
close $out or die "Unable to close output file: $!";
print $rowcount;
my $current_size = -s $target_full_path; # how many bytes now
printf( "File %s was %d bytes, is now %d bytes\n",
$target_full_path, $original_size, $current_size );
Maybe the reports you get from that version will tell you what you need to know.
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.