4 ms·
That will not always pass. if (exists $foo->{bar}){ .. will not run .. } if ($foo->{bar}) {...} if (exists $foo->{bar}){ .. will run .. }
by seeken 13y ago
That will not always pass.
if (exists $foo->{bar}){ .. will not run .. }
if ($foo->{bar}) {...}
if (exists $foo->{bar}){ .. will run .. }
- eieio 13y agoI see, thank you. I am certainly a perl novice.
- pflanze 13y agoThat doesn't do any autovivification. You meant (note the referencing down a deeper level than the exists test): if (exists $foo->{bar}){ .. will not run .. } if ($foo->{bar}->{baz}) {...} if (exists $foo->{bar}){ .. will run .. }
- seeken 13y agoCan't believe I've had that wrong for so long. Must have misinterpreted it right when I learned perl and have always been careful about it.