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

Re: use strict won't require explicit name for all variables?

by ViceRaid (Chaplain)
on Feb 28, 2002 at 10:19 UTC ( #148180=note: print w/ replies, xml ) Need Help??


in reply to use strict won't require explicit name for all variables?

I suspect that it's because $a and $b are, in some places, variables with a "special" meaning to Perl. I'm thinking particularly of sort, which uses $a and $b to stand for the values being compared. If I change the script to use, say $x and $y, I get a strict error, as I'd expect.

This would make $a and $b a bit like the punctuation variables. $_, for example, doesn't need to be explicitly scoped before you use it, which is partly why it's useful as a shortcut.

/=\


Comment on Re: use strict won't require explicit name for all variables?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2015-08-01 00:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (285 votes), past polls