my $infile = '/tmp/bla.txt'; open my $infh, '<', $infile or die "open(ro,$infile) failed: $!"; # ... close $infh;