if ( open my $handle, '<', $file ) { ... } else { print $!, "\n"; #warn "Cannot open file '$file' to read: $!"; }