[OT] perl file handle question

Jonathan Stowe jns at gellyfish.com
Sat Mar 22 17:33:35 GMT 2008


On Sat, 2008-03-22 at 21:54 +0900, Simon Cozens wrote:
> Nicholas Clark wrote:
> > However, what I'd then like to do is
> > 
> > close_or_die($fh);
> > 
> > and if the close fails, have the file *name* printed in the error message.
> 
> Do you need it to be portable?
> 
> This answer brought to you by the keywords readlink, fileno, and 
> "/proc/$$/fd".
> 

The code of Linux::Fuser does the reverse but could do it both ways ....

/J\


More information about the london.pm mailing list