dk has asked for the wisdom of the Perl Monks concerning the following question:
I cannot figure out how to override close() properly. If I do it as
use strict; use warnings; BEGIN { *CORE::GLOBAL::close = sub { 1 }; }; close STDIN;
then I get the bareword "STDIN" not allowed error. Sure I can call it as close \*STDIN but that beats the purpose of the override itself.
Any ideas? Thanks!
Update: solved, ikegami++!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CORE::GLOBAL::close - how to override properly
by ikegami (Patriarch) on Oct 11, 2010 at 07:34 UTC | |
by dk (Chaplain) on Oct 11, 2010 at 08:08 UTC |