Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by Xiong (Hermit)
on Feb 08, 2012 at 10:11 UTC ( [id://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

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";

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-19 19:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found