in reply to Re: dynamic sub routine definitions?
in thread dynamic sub routine definitions?

BZZZZZZZT! Please try again.

You can't use stuff like this to replace an existing function definition, only to add a new one.

You can too! You just have to be even neato-er.

FILE1 ----- *{"::SomeFunc"} = sub { print "I'm neater than that!\n" } FILE2.pl -------- sub SomeFunc { print "I'm really neat\n"; } my $neato = 'FILE1'; do $neato; &SomeFunc;

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Replies are listed 'Best First'.
Re (3): dynamic sub routine definitions?
by VSarkiss (Monsignor) on Jul 17, 2002 at 18:05 UTC

    Please read what I wrote more carefully. The paragraph goes on to say:

    What you want can be done, but requires more work: you need a level of indirection.
    You just demonstrated my point: it can be done, but you had to go through the package hash (a level of indirection) to do it.