in reply to Automatically add all defined functions to your @EXPORT

Not only very handy, but IMO, a textbook example of the Snippet genre.

I will make a tiny modification for my use:

grep +( defined &$_ and !/^_/ ), keys %{ __PACKAGE__ . '::'};
...to keep _private_functions and __ANON__...s unexported.

Update: I just realized that what I wrote above is almost identical to merlyn's earlier earlier follow-up... D'oh!

the lowliest monk

Replies are listed 'Best First'.
Re^2: Automatically add all defined functions to your @EXPORT
by merlyn (Sage) on Jun 21, 2005 at 15:53 UTC
    __ANON__
    I realize you struck that out, but I just tested, and even though creating an anonymous subroutine pokes an __ANON__ into the symbol table, the defined test fails, so this would never pick up on that. Unless you happened to also call a subroutine __ANON__.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

      Well, I'm glad you checked, because I had a (rather embarrassing) bug in my test, which incorrectly showed the __ANON__s as passing the defined &$_ .

      the lowliest monk