undefined . , ! ?
use warnings. ?
:
use v5.12;
use strict;
use warnings;
.:)
NB: , . , , . , .
CPAN autovivification . :
use v5.10;
use strict;
use warnings;
no autovivification;
my %md_hash = ();
$md_hash{top}{primary}{secondary} = 0;
if ($md_hash{top}{foobar}{secondary} == 0) {
say "yup, that was zero.";
}
, :
$ perl /tmp/demo
Use of uninitialized value in numeric eq (==) at /tmp/demo line 10.
yup, that was zero.
- ==. RHS 0. LHS undef . undef 0, , LHS, RHS 0, == .
, ysth , , " - ". , , - , ==. undef 0.
autoviv, , - CPAN. , , autoviv. , , undef.
, , "" , undefined lvalue . :
$md_hash{top}{foobar}{secondary}
$md_hash{top}->{foobar}->{secondary}
${ ${ $md_hash{top} }{foobar} }{secondary}
, lvaluable undef Perl, . , autovivs.
, autoviv. autoviv - , , , . - : , autoviv. autoviv ( , : ).
, . , . Perl, . , C
if (p && p->whatever) { ... }
, . , . Perl , - , , , , .