Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

by Xiong (Hermit)
on Feb 08, 2012 at 10:11 UTC ( #952450=note: print w/ replies, xml ) Need Help??


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

Thank you, moritz. I have given, in each of the three examples, code that fails a stricture; and a solution that passes strictures with exactly the same output as the failing code under no strictures. I'm not sure that's wise; it's merely simple.

I'm a little afraid to step into the tar pit of Here are some of the things you might have been meaning when you got this error and here are some possible solutions. I did have the impulse and I agree that it might be helpful. Perhaps another node?

If I see a proposed example and solution illustrating a strict 'refs' violation using a hash, I'll be glad to substitute it.

I'm not the guy you kill, I'm the guy you buy. —Michael Clayton


Comment on Re^2: RFC: Tutorial: use strict; now what!?
Download Code
Re^3: RFC: Tutorial: use strict; now what!?
by runrig (Abbot) on Feb 08, 2012 at 18:30 UTC
    I was going to say the same thing as moritz. In the spirit of your example, here is perhaps what was meant:
    my $pet = 'dog'; my %pet_name; $pet_name{$pet} = 'Rover'; print "$pet_name{dog}\n";

      Please show me the matching problem code?

      I'm not the guy you kill, I'm the guy you buy. —Michael Clayton
        our $dog; my $pet = 'dog'; ${ $pet } = 'Rover'; # no strict 'refs' print "$dog\n";

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (12)
As of 2014-09-02 13:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (22 votes), past polls