#!/usr/bin/perl -w use strict; open my $fh,'<','does not exists' and die "This file should not exist"; print <$fh>; close $fh; open $fh, '<','exists.txt' or die "Not opened: $!\n"; close $fh; print <$fh>;