SleepyJay has asked for the wisdom of the Perl Monks concerning the following question:
@{ $self->bar || +[] }
What's with that '+' in there? I mean, I get that it is usually used for disambiguation (e.g. @{ $self->bar || +shift }). But, what makes this plus needed?
(I'm not a Perl beginner, but I have never seen Perl like this: is this a dumb question?)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Array Plus Operator
by shmem (Chancellor) on Dec 15, 2017 at 14:58 UTC | |
by SleepyJay (Beadle) on Dec 15, 2017 at 15:01 UTC | |
by AnomalousMonk (Archbishop) on Dec 15, 2017 at 18:08 UTC | |
|
Re: Array Plus Operator
by QM (Parson) on Dec 18, 2017 at 11:09 UTC | |
|
Re: Array Plus Operator
by Anonymous Monk on Dec 16, 2017 at 00:47 UTC |