Hi,
I have some code similar to the following
<%once>
my $process = sub {
# open epitomy file
open(EPITOMY, '>' . $r->document_root() . '/data/userfile.txt');
# create a DBI statement handle...
while (my @data = $sth->fetchrow()) {
# write epitomy file line
print EPITOMY (join('|',
@data
), "\n");
}
close(EPITOMY);
};
</%once>
% $process->();
However, although the statement handle returns many rows it only prints the
final one to the file handle. I wave 'warn'ed the @data array on each
iteration instead of printing it to the filehandle and the log does show all
rows.
Is there an issue with using filehandles in this way? Does the filehandle
not get closed or updated properly?
Cheers,
Pete
----------------------------------------------------------------------------
Popcorn Web Design ltd
15A, Cambridge Road, Stansted, Essex CM24 8BX
t: 01279 812229
f: 0870 831 6999
www.popcornwebdesign.co.uk
This email is confidential. It may also be privileged or otherwise protected
by other legal rules. If you are not the intended recipient please notify
the sender immediately, and delete the message from all locations in your
computer. You should not copy the email or use it for any purpose, or
disclose its contents to any other person: To do so may be unlawful. Email
is subject to possible data corruption you should not rely on advice
contained in an email without obtaining written confirmation of it.
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users