lakshmananindia has asked for the wisdom of the Perl Monks concerning the following question:
I executed the above code and I put "cat a"use strict; use warnings; sub handler { open FH,">a"; print FH @_; } $SIG{__DIE__}=\&handler; close STDERR; die "Exit from the program";
I expected only one line, but it has 2 lines.
If I remove the close STDERR statement then my file contains only one line.
I checked with perl -d. The handler is called only once.
Why it is printing twice when "close STDERR" is there?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Log message in Die handler
by zwon (Abbot) on Jan 16, 2009 at 12:42 UTC | |
by gone2015 (Deacon) on Jan 16, 2009 at 13:36 UTC | |
|
Re: Log message in Die handler
by almut (Canon) on Jan 16, 2009 at 13:45 UTC | |
|
Re: Log message in Die handler
by ack (Deacon) on Jan 16, 2009 at 16:16 UTC | |
|
Re: Log message in Die handler
by targetsmart (Curate) on Jan 17, 2009 at 15:45 UTC |