What you can do is read the source of Fatal.pm. This module replaces function such as open or close with versions that automatically die when they fail. This should give you some ideas.
You can also use this module to do the following:
use Fatal qw(:void open close);This is useful because any open or close called in void context (such as the examples you provide) will automatically fail.
You can also check out Function::Override which allows you to add callback to existing functions, which would solve your problem perfectly.
Cheers,
Ovid
New address of my CGI Course.
Silence is Evil (feel free to copy and distribute widely - note copyright text)
In reply to Re: Replicate open() and close()
by Ovid
in thread Replicate open() and close()
by BigLug
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |