The phrase "in the first iteration of your while loop" made me think of something other than the way I would do it, but the idea is at least very similar. Like this:
$sth->execute();
my @ary= $sth->fetchrow_array();
if( @ary ) {
open(MAIL,"|$mailprog -t");
print MAIL ...
do {
print MAIL join ("\t", @ary), "\n";
} while( @ary = $sth->fetchrow_array() );
print MAIL "\nEND OF SCHEDULED EVENTS!\n";
close(MAIL);
}
$sth->finish();
- tye (at least very similar to "Tye") |