in reply to Re: Logical/defined or as lvalue
in thread Logical/defined or as lvalue
When would it be useful?
Consider items from @list to be counted, with one "given" set and a "rest". A pre-initialized hash %h1 holds the "given" set and an empty hash %h2 counts the rest. Then we could:
${\($h1{$_} // ($h2{$_} //= 0))}++ for @list;
Greetings,
🐻
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Logical/defined or as lvalue
by ikegami (Patriarch) on Sep 03, 2024 at 20:25 UTC | |
Re^3: Logical/defined or as lvalue
by LanX (Saint) on Sep 03, 2024 at 20:45 UTC |