The subroutime : deal_add_other
What is the statement means:
Code: Select all
my $item = $currentDeal{other}{ $args->{nameID} } ||= {};
I never seen the syntax like this ?
Would you giive me some help of explain ?
Moderator: Moderators

Code: Select all
my $item = $currentDeal{other}{ $args->{nameID} } ||= {};

Code: Select all
$currentDeal{other}{ $args->{nameID} } ||= {};
my $item = $currentDeal{other}{ $args->{nameID} };

Not double assignment !EternalHarvest wrote:If the double assignment confuses you, it's the same as:Code: Select all
$currentDeal{other}{ $args->{nameID} } ||= {}; my $item = $currentDeal{other}{ $args->{nameID} };

Code: Select all
$currentDeal{other}{ $args->{nameID} } = $currentDeal{other}{ $args->{nameID} } || {}


No, wait. And you can't "increment" references in Perl.sofax222 wrote:It is a increasement of hash reference !
