in reply to Re: Sub on the fly?
in thread Sub on the fly?

However, that would only work if you were within the blork package, so if you wanted to install the method from main:: then this *blork::foo = sub { ... } is more approriate.

-stvn

Replies are listed 'Best First'.
Re^3: Sub on the fly?
by phaylon (Curate) on Aug 17, 2006 at 15:41 UTC
    Well, assuming that most of these things will happen dynamically, I'll raise yours by
    { no strict 'refs'; *{ $class . '::' . $name } = sub { ... }; }
    *scnr* Update: As you already did below. *slaps-self*

    Ordinary morality is for ordinary people. -- Aleister Crowley