in reply to Catching errors in closing lexical filehandles

As an aside, that snippet works in 5.6.1, and as far as I know, worked with much earlier versions too. What was introduced in in 5.8.0 was the ability to use a reference for the filename as an alternative to IO::Scalar.
  • Comment on Re: Catching errors in closing lexical filehandles

Replies are listed 'Best First'.
Re^2: Catching errors in closing lexical filehandles
by gaal (Parson) on Sep 27, 2004 at 14:57 UTC
    On 5.005_03, you'd get a "Can't use an undefined value as filehandle reference" error at compilation. Hence the gensym.
      I see, thanks! good to know what works and doesn't work in which version. I'm so used to using FileHandle, which uses gensym.