in reply to Re: Re: Automatically export all subs in a module
in thread Automatically export all subs in a module

chip - you're right - but we've *already* named the package once... so perhaps this would be better:
@EXPORT = grep {defined *{${__PACKAGE__.'::'}{$_}}{CODE} } keys %{__PA +CKAGE__.'::'} ;
Unfortunately you need to switch to no strict 'refs' in order to use it, which is a shame, but there you are (unless someone else can do it strictly).

andy.

Replies are listed 'Best First'.
Re: Re: Re: Re: Automatically export all subs in a module
by runrig (Abbot) on Dec 20, 2001 at 00:12 UTC
    'no strict ...' is ok as long as you know what you're doing. And we're doing it under strictly controlled conditions here (if you scope it as I did above, or if you're a madman like Damian)...but it would be no strict 'refs' not vars :-)
      You're right - but I'd already noticed and fixed it (typo, honest! :). I was amused to see that we'd both looked at the post above and thought exactly the same thing.

      andy.

Re: Re: Re: Re: Automatically export all subs in a module
by George_Sherston (Vicar) on Dec 20, 2001 at 20:44 UTC
    You chaps are the best... not seen such elegance since Paris fashion week... it's installed and working. May I suggest this is one for the Snippets section?

    § George Sherston