open my $filehandler,'<',$file or die "can't open file: $!"; # .... others codes close $filehandler or die "can't close file:$!";