use strict; use warnings; use IO::Handle; my $fh = IO::Handle->new; $fh->open('something.txt') or die("could not open file $!\n");