John W. Krahn wrote:
Shawn H. Corey wrote:
Wagner, David --- Senior Programmer Analyst --- CFS wrote:
I am done processing and I want to place the final output line also on the screen. Here is what I have:

    if ( $GlblInfo{audit} ) {
printf "\n\n*****Should be last line in the audittrail file...*****\n\n";
        close(STDOUT);
        close(STDERR);
        open(STDOUT , '>') || die "Unable to open STDOUT: $!";

You're not opening STDOUT to anything. And you closed STDERR so the die message can't go anywhere. In fact, it goes into an infinite loop.

No it doesn't, there is no loop there.


It goes into an infinite loop on my machine. I suggest you try it before you make such blanket statements.

Never close STDERR; just open it to the null device:

open STDERR, '>', '/dev/null';

And don't add the traditional die; if it fails, there's nowhere to report the failure.


--
Just my 0.00000002 million dollars worth,
  Shawn

Programming is as much about organization and communication
as it is about coding.

Regardless of how small the crowd is, there is always one in
it who has to find out the hard way that the laws of physics
applies to them too.


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to