Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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 examining the Monastery: (9)
As of 2014-08-20 17:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (121 votes), past polls