Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

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

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://952450]
[ambrus]: Corion: really? Does that mean the Prima watcher objects behave as handles that stop the watcher when they're destroyed, just like AnyEvent expects?
[ambrus]: "all the bugs" -- hehe, good luck
[ambrus]: Corion: what I don't understand is, if you make a one-shot AnyEvent timer with short timeout, does this code guarantee that the Prima timer can't queue two timeout events before invoking any of them?
[ambrus]: Because that could break AnyEvent code, which is why I added a guard.
[ambrus]: (It might be easier to use the callback scalar as a guard, as in $c and &$c(); $c = ();)

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

    Results (150 votes). Check out past polls.