Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to Why doesn't Perl default (more)

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11120914]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2024-04-26 07:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found