Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

by educated_foo (Vicar)
on Feb 09, 2012 at 12:21 UTC ( #952698=note: print w/replies, xml ) Need Help??


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

It's not so hard:
package P; while (<>) { my ($k, $v) = split; $$k = $v; } for my $k (keys(%P::)) { ... $$k ... }

Replies are listed 'Best First'.
Re^5: RFC: Tutorial: use strict; now what!?
by moritz (Cardinal) on Feb 09, 2012 at 12:51 UTC

    ... 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.
Re^5: RFC: Tutorial: use strict; now what!?
by ikegami (Pope) on Feb 09, 2012 at 22:25 UTC

    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://952698]
help
Chatterbox?
[shmem]: man perlfunc |perl -nle '$ok++ if /Alphabetical Listing of Perl Functions/;if($ok ){$s{$1}++if /^ (\w+)/}}{for(keys %s){$f="prototype \\\&CORE::$_"; eval"$f"||delete $CORE::{$_}}print for sort keys%CORE::'
[shmem]: well, there are some builtins which don't have a prototype...
[Discipulus]: eh eh.. i was looking in toke.c but dunno if is already used
[shmem]: oh the whitespace in the regex got condensed, meh
[shmem]: should be /^ {7}(\w+)/ or such
[shmem]: ...at least for my perldoc on Linux debian 8
[Discipulus]: mmh.. at themomemt i just an old 5.8 and outputs just GLOBAL::

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2017-05-23 10:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?