warpod has asked for the wisdom of the Perl Monks concerning the following question:
when executed it says:==== test. pl ====== #!/usr/bin/perl use strict; use mmm; local* F; mmm::fopen(F, ">tst"); print F "hi"; mmm::fclose F; ==== mmm.pm ====== #!/usr/bin/perl use strict; package mmm; BEGIN {} sub fopen(*;$) { local *FH = $_[0]; return CORE::open(FH, $_[1]); } sub fclose(*) { local *FH = $_[0]; return CORE::close(FH); } END { } 1;
works just fine. What is wrong in package?local* F; fopen(F, ">tst"); print F "hi"; fclose F;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: filehandle question
by BrowserUk (Patriarch) on Oct 11, 2004 at 13:47 UTC | |
|
Re: filehandle question
by revdiablo (Prior) on Oct 11, 2004 at 17:00 UTC | |
|
Re: filehandle question
by hv (Prior) on Oct 11, 2004 at 14:30 UTC | |
|
Re: filehandle question
by bobf (Monsignor) on Oct 11, 2004 at 16:53 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |