http://www.perlmonks.org?node_id=952450


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

Replies are listed 'Best First'.
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";