Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

(ichimunki) re: assigning to $_

by ichimunki (Priest)
on Feb 24, 2001 at 19:46 UTC ( #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
Node Status?
node history
Node Type: note [id://60655]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2021-04-13 10:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?