in reply to Array Plus Operator
There's no difference between these two lines
@{ $self->bar || +[] }; @{ $self->bar || [] };
since there is no ambiguity. [] returns a scalar - a reference to an anonymous, empty array - in either case. But the original author perhaps thought it was needed. AFAIK this doesn't behave different in any perl5.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Array Plus Operator
by SleepyJay (Beadle) on Dec 15, 2017 at 15:01 UTC | |
by AnomalousMonk (Archbishop) on Dec 15, 2017 at 18:08 UTC |