Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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?
[1nickt]: argue == discuss && argue == be contentious
[Discipulus]: you are right 1nickt i didnt voted nor downvoted; I just upvote perl content i like
[1nickt]: In Spanish, to argue (like a fight) is discutir -- does not mean to discuss !
[1nickt]: Sigh, this is why I gave up human-only languages and became a Perl linguist :-)
[Discipulus]: i just, rarely, downvote unpolite posts and spam, and wrong advices
[Discipulus]: discutere in eatalian is neutral: but discutere with wife sounds implicitly negative..
[erix]: what's the offending signature?
[Discipulus]: 'give man a fish erix it sonds like a push towards omosexuality.. ;=)
[Discipulus]: see Re: from txt file to array erix
[erix]: yeah, I ask for the text (I don't see signatures)

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2017-06-22 12:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (519 votes). Check out past polls.