qball has asked for the wisdom of the Perl Monks concerning the following question:

Hello ..

How can I combine the following code to print to FR.DOC? I'm sort of confused. In addition, I'll be adding two more code sections to print other "reports" appended to FR.DOC.
sub docFullReport(){ ##################################################### # # Limited Section # ################## open(PB_BODY_LIMITED, "> tmp/FR.DOC") or die "Can't $!\n"; #Lock File flock(PB_BODY_LIMITED, 2); $sql = <<END_SQL; SQL CODE(didn't post it here) END_SQL $query = &execsql($sql); $~ = PB_TOP_LIMITED; write PB_TOP_LIMITED; $~ = PB_BODY_LIMITED; write PB_BODY_LIMITED while( @data = $query->fetchrow ); ##################################################### # # Detailed Section # ################## $sql = <<END_SQL; SQL CODE(didn't post it here) END_SQL $query = &execsql($sql); $~ = PB_TOP_DETAILED; write PB_TOP_DETAILED; $~ = PB_BODY_DETAILED; write PB_BODY_DETAILED while( @data = $query->fetchrow ); }

The code is somewhat incomplete. I'll happily answer any questions to make sense of what I'm trying to do.

Thanks.

qball~"I have node idea?!"

Replies are listed 'Best First'.
Re: Combine File Request
by tadman (Prior) on Apr 19, 2001 at 01:30 UTC
    I'm not exactly sure what you're saying, but if you want to write several different things to the same file, you might open it with the append option:
    open(PB_BODY_LIMITED, ">> tmp/FR.DOC") or die "Can't $!\n"; ^^