in reply to Re: Re: 'strict refs' + 'strict sub' = suck.
in thread 'strict refs' + 'strict sub' = suck.

Since Perl 5.6.0 we can perform file operations using a scalar - which is quite convenient to pass around in function calls. For example -

open my $fh, ">output.txt" or die "Can't create output: $!"; print {$fh} "Hello world!\n"; close $fh; # if don't close, then it will be closed # automatically when $fh is out of scope.
However the above code is not valid in version of Perl prior to 5.6.0, which I am still using on some of the production boxes. However the following will work on Perl prior to 5.6.0.
my $fh = IO::File "output.txt", "w" or die "Can not create output: $!"; print $fh "Hello world!\n"; undef $fh;
My preference of IO::File over open is on the Perl version compatibility and also ease of use.

This is only my personal perference however.