Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

(ichimunki) re: assigning to $_

by ichimunki (Priest)
on Feb 24, 2001 at 19:46 UTC ( [id://60655]=note: print w/replies, xml ) Need Help??


in reply to Re: The Marcel Perl Questionnaire
in thread The Marcel Perl Questionnaire

Why? Again. Why?

That variable has so many side-effects from normal processing that assigning to it is likely to bite you rather quickly.

You can't use the impersonal pronouns (he/she/it in english) without first either using the actual noun, or unless the actual is strongly implied.

Witness:
"It runs." -- um, what does?
"The dog has spots. It runs." -- now we know what runs.
"The dog has spots. The cat has stripes. It runs." -- the dog or the cat?

I don't know what others think, but I'd say you aren't solving a real problem by not using an actual variable name, but you might be causing some.

Good variable names give clues about what is in that data structure, and how it would normally be used. $_ gives no indication anything.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-04-23 18:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found