in reply to simple to describe I/O problem

I fail to see the usefulness of such a complicated construct:
use IO::File; # ... my $fh=IO::File->new; if ($fh->open($file,"<")) { # ...
when the whole thing can be done in just one single line of code:
open my $fh, "<", $file or die "Can't open $file $!";
To me, this is just looking like pointless over-engineering. Or perhaps OO-fashion victim. Or an application of the following principle: why should we make things simple when they can be made more complicated? Just the contrary of the Perl principles stated many times by Larry Wall and others: to make easy jobs easy.

Replies are listed 'Best First'.
Re^2: simple to describe I/O problem
by Anonymous Monk on Sep 01, 2014 at 20:54 UTC

    I believe one of the advantages of using IO::Handle (from which IO::File inherits) is to have a little more control on a per-handle basis, such as being able to do $io_handle->autoflush(1). Other than that I agree.

      Agreed. I am not saying that that the IO::xxx hierarchy is useless, but just that, in the case in point, this seems to be overkill.