Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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?
[choroba]: just one of its angles, in fact
[LanX]: <|--
[choroba]: Reminds me of an old joke about an orchestra...
erix imagines that in a true Lancs accent
[choroba]: so a Czech orchestra rehearses a new piece by a German composer
LanX LOL of the day ... the Turkish Anonymous Alcoholics stopped their "No to alcohol" campaign for political reasons ...
LanX omg my browser is posting again on its own ...
[LanX]: choroba: GREAT JOKE! xD

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2017-03-27 11:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (319 votes). Check out past polls.