in reply to Implicit closing of files

I'm not sure whether there might be problems on a Windows platform, I generally use Solaris and have not had problems with implicit closing. However, I would advise the use of lexical filehandles plus the three-argument form of open and a check for success.

{ { open my $fh, q{>}, q{outfile.txt} or die qq{open: > outfile.txt: $!\n}; print $fh qq{ ... }; } }

I hope this is of interest.

Cheers,

JohnGG

Replies are listed 'Best First'.
Re^2: Implicit closing of files
by rovf (Priest) on Jun 17, 2008 at 11:14 UTC
    3-arg open is for sure the better alternative in general, because there is no problem with "funny characters" in the filename, which could change the meaning of the open. In my concrete case however, this turns out not to be a problem.
    -- 
    Ronald Fischer <ynnor@mm.st>