BigLug has asked for the wisdom of the Perl Monks concerning the following question:
I want to do something like:
where my_open and my_close would do the exact same as open() and close(), but also do "other stuff" (like logging that the file was opened/closed).my_open(FILEHANDLE,">$filename"); print FILEHANDLE "This is the file's content"; my_close(FILEHANDLE);
When I run Data::Dumper on a function called in the above manner, it treats the unquoted string 'FILEHANDLE' as a string. I'd *prefer* not to have to use *FILEHANDLE or $FILEHANDLE outside the sub. What happens in the sub doesn't concern me ... I would make it an OBFU if it would work :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Replicate open() and close()
by Ovid (Cardinal) on Jan 29, 2003 at 22:51 UTC | |
|
Re: Replicate open() and close()
by chromatic (Archbishop) on Jan 29, 2003 at 22:54 UTC | |
|
Re: Replicate open() and close()
by clairudjinn (Beadle) on Jan 30, 2003 at 00:05 UTC | |
|
Re: Replicate open() and close()
by Fletch (Bishop) on Jan 29, 2003 at 22:36 UTC | |
by sauoq (Abbot) on Jan 29, 2003 at 22:52 UTC | |
by BigLug (Chaplain) on Jan 29, 2003 at 22:56 UTC | |
by sauoq (Abbot) on Jan 30, 2003 at 00:05 UTC | |
|
Re: Replicate open() and close()
by robartes (Priest) on Jan 30, 2003 at 00:00 UTC | |
|
Thanks all! Re: Replicate open() and close()
by BigLug (Chaplain) on Jan 30, 2003 at 00:33 UTC |