Keep It Simple, Stupid | |
PerlMonks |
Re: Why doesn't Perl default (more)by tobyink (Canon) |
on Aug 19, 2020 at 17:21 UTC ( [id://11120914]=note: print w/replies, xml ) | Need Help?? |
If push @a; were currently a syntax error, then it would make sense for it to mean push @a, $_; because doing something useful is better than a compilation error. But push @a; isn't a syntax error — it actually does do something — it pushes the empty list onto the array. Pushing an empty list might seem like a no-op which could never be useful, but if you think that, you're forgetting about tied arrays.
In Section
Seekers of Perl Wisdom
|
|