in reply to Referencing methods

I believe an anonymous sub would work:
&iterate(sub { $rep->attach() },@param);
Untested, of course.

Replies are listed 'Best First'.
Re: Re: Referencing methods
by chip (Curate) on May 08, 2003 at 16:03 UTC
    That's great except it doesn't pass the parameters down. So perhaps this instead:

    iterate(sub { $rep->attach(@_) }, @param);

    Also, you may wish to give iterate an appropriate prototype, making the sub keyword unnecessary:

    sub iterate (&@); iterate { $rep->attach(@_) }, @param;

    Share & Enjoy!

        -- Chip Salzenberg, Free-Floating Agent of Chaos