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

Re^3: RFC: Tutorial: use strict; now what!?

by moritz (Cardinal)
on Feb 09, 2012 at 05:06 UTC ( #952659=note: print w/ replies, xml ) Need Help??


in reply to Re^2: RFC: Tutorial: use strict; now what!?
in thread RFC: Tutorial: use strict; now what!?

However, in almost all cases a hash based solution is done is such away it has all the disadvantages of not using strict, and none of the advantages.

I disagree. Most beginner's uses of soft references are along the lines of

while (<>) { while (/([a-z]+)/g) { my $word = $1; $$word++; } } print "I've seen the word 'compiler'\n" if $compiler; # similar checks for a few other variables here

If you do that with a hash instead, you have a very clear benefit: you don't run into the risk of accidentally changing any our-scoped scalars in the current package.


Comment on Re^3: RFC: Tutorial: use strict; now what!?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2014-08-30 07:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (291 votes), past polls