Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Make $^V and "my" implicit

by ikegami (Pope)
on Feb 03, 2014 at 17:42 UTC ( #1073239=note: print w/ replies, xml ) Need Help??


in reply to Make $^V and "my" implicit

why do I have to type use 5.016; at the top of every script?

You don't. You only need to this if you want version 5.16 of the language. Having the features always on or on by default would break programs, which is the very reason they were made features you need to turn on.

If we've admonished for so many years to (almost) always use "my" variables for proper scoping surely it is now time to makey "my" implicit?

Because having you declare them finds spelling errors. This is the worse suggestion for a change in Perl I have ever heard.

(I'm assuming you're not suggesting that we'd no longer be able to declare them explicitly. That would be even worse.)


Comment on Re: Make $^V and "my" implicit
Download Code
Re^2: Make $^V and "my" implicit
by gunzip (Monk) on Feb 03, 2014 at 17:54 UTC
    See my reply to Corion above. I'm not against what "my" stands for. Just reserve its use for cases where it really makes a difference, ie. same variable name and type ($@% etc.) used in different scopes. Forget it for anything else.

      That doesn't address what I said at all. If declaring variables isn't always required, typos in variable names can't be found. This would be a major loss. As such, declaring variables is always required, always makes a difference.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2014-12-27 18:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls