Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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

by ikegami (Pope)
on Feb 09, 2012 at 05:50 UTC ( #952661=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

Not even close.

How is the following remotely the same as a program without strict:

while (<>) { my ($k, $v) = split; $h{$k} = $v; } for my $k (keys(%h)) { ... $h{$k} ... }

Replies are listed 'Best First'.
Re^4: RFC: Tutorial: use strict; now what!?
by educated_foo (Vicar) on Feb 09, 2012 at 12:21 UTC
    It's not so hard:
    package P; while (<>) { my ($k, $v) = split; $$k = $v; } for my $k (keys(%P::)) { ... $$k ... }

      ... and the maintenance programmer who adds one or two features later will think you for occasionally, silently overwriting a few of his our-variables.

        In package P? I would never write real code this way, but ikegami's post was deliberately, absurdly clueless.

      It's not so hard

      Really? I don't see how the code you posted shows that the code I posted suffers from the same problems that strict refs is suppose to fix. Am I missing something?

      In fact, your code actually reinforces my point. our $x = 123; affects your code but not mine, so hashes are NOT just as bad as symbolic refs.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://952661]
help
Chatterbox?
[LanX]: fun, last time I was in Britain people had problems with my name, just rarely they said "like the children TV star Rolf Harris?", this time most replied instantly "Rolf? like the pedophile Rolf Harris" ?
LanX is perlophile
[ambrus]: Corion: read https://metacpan. org/pod/release/ MLEHMANN/AnyEvent- 7.13/lib/AnyEvent. pm#SUPPLYING-YOUR- OWN-EVENT-MODEL- INTERFACE in that case

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2016-12-08 12:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (141 votes). Check out past polls.