Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^4: "$_" vs. $_

by mrpeabody (Friar)
on Apr 10, 2007 at 19:47 UTC ( [id://609241]=note: print w/replies, xml ) Need Help??


in reply to Re^3: "$_" vs. $_
in thread "$_" vs. $_

Um, in both examples you are not setting $_---you are only modifying it.
Interesting distinction. I think of them as synonyms, and would certainly argue that any statement that starts with "$_ =" is "setting" the variable. However, what name we use when giving a variable a new value is not really the point.

What makes both of these examples useful is that they implicitly alias $_ to another variable before acting on it. That's where they differ from the OP's usage.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2024-04-19 10:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found