in reply to Replicate open() and close()

If you are using perl 5.8.0, you could play around with the overload pragma as well.
use overload "open" => \&subref; use overload "close" => \&subref;