[OT] perl file handle question

Simon Cozens simon at simon-cozens.org
Sat Mar 22 12:54:23 GMT 2008


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".

-- 
s//'"$14$11$9$3$15$1$2$8$3$7$6$13$15$12$6$13$5$15$7$1$4$10$6$13"'/e;eval{1->sk};
$@=~/.(.)(.).(.).(.).(.)...(.).(.)(.)...(.)(.).{7}(.).{4}(.).{8}(.)...(.)...(.)/
;print eval;


More information about the london.pm mailing list