In article < >,
Chris Heller <> wrote:
:Is it possible to write a subroutine in Perl that would act just like
:a call to open()?
Yes. In fact, instead of writing "myopen", you could override
open() itself within your package, with your open() calling
CORE:

pen() if you need to have the "real" open do something
for you.
:I have a project which currently uses NFS for file storage. This being
:a web project, and NFS being what it is, the decision has been made to
:remove dependancy on NFS. Of course this needs to be done in the
:simplest possible manner, so I've devised a simple file-transfer

rotocol and server and thought it would be great if I could simply
:replace calls to open() and close() with myopen() and myclose().
Consider using nget or curl instead of writing your own file
transport protocols. But it depends in part on whether your
application just needs to read the file, or needs to be able
to update it.
If it needs to be able to update the file, then consider looking at the
perltie documentation for information on how to tie a filehandle so
that behind the scenes you can substitute your own remote seek/read
seek/write routines.
--
Cottleston, Cottleston, Cottleston pie.
A bird can't whistle and neither can I. -- Pooh