Hi Athanasius,
I'm curious, what in your view is the advantage of using Logical Defined-Or over simple Logical Or in the OP's situation?
$ perl -Mstrict -Mwarnings -E' my $foo; say (defined $foo ? "1: defined" : "1: not defined"); my $bar = $foo; say "2: bar: $bar"; my $baz = $foo || "baz"; say "3: baz: $baz"; my $qux = $foo // "qux"; say "4: qux: $qux"; ' 1: not defined Use of uninitialized value $bar in concatenation (.) or string at -e l +ine 5. 2: bar: 3: baz: baz 4: qux: qux
Thanks!
In reply to Re^2: if defined not working
by 1nickt
in thread if defined not working
by liorlew
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |