in reply to Filehandles when Open Fails
output if 'exists.txt' exists:#!/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>;
readline() on closed filehandle $fh at test.pl line 4. readline() on closed filehandle $fh at test.pl line 9.
|
|---|