Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by moritz (Cardinal)
on Feb 09, 2012 at 05:06 UTC ( [id://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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-25 04:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found