in reply to Devel::GetSymbols (fka Symbol::List)

I like it!

What I'd like to see in it too, was to have the possibility to further restrict contents of the result by a regular expression.

I know, you could do something like:

@EXPORT_OK = grep /^[^_]/, Symbol::List::symbols('CODE');
to filter out subs beginning with '_', but as you do a grep in symbols() already, it would be more convenient to pass a regex.

Replies are listed 'Best First'.
Re: Re: Symbol::List
by Juerd (Abbot) on Jan 23, 2002 at 18:06 UTC
    I don't think passing a regex adds much, because grep is so easy to use. And after all, it's what grep is for.
    @EXPORT_OK = grep !/^_/, Symbol::List::symbols('CODE');


    BTW, Symbol::List is not just for exporting :)

    2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$