use IO::File; my $fh = IO::File->new; $fh->open($path, O_BINARY|O_RDONLY) or die $!;