http://www.perlmonks.org?node_id=334321


in reply to RFC: new module r (or R)

I think that sam has a good point. This would make a good script, but I disagree that it wouldn't make a good module. As it stands now, with all the work being done in import and with @ARGV, it is not really reusable outside of the command line scenario. But if you refactor the code, you could easily make it useable in other scenarios as well. Allowing arguments other than through @ARGV and making import check its execution context before it does any magic would increase the usefulness of this module immensly.

And then package the script in your CPAN distribution, and you get the best of both worlds. This too would allow you to name the module better, as R is incredibly un-descriptive and tells me absolutely nothing about what it does.

Basically I think that you have some good things going here, and to restrict its usefulness to one scenario would be a waste of your effort.

-stvn

Replies are listed 'Best First'.
Re: Re: RFC: new module r (or R)
by jryan (Vicar) on Mar 06, 2004 at 04:03 UTC

    But why is it bad that it is only useful from a command-line scenario? Why does it have to be extended? It seems perfectly designed for what it would be most useful for.

      But why is it bad that it is only useful from a command-line scenario?

      It's not that it is bad, its that it could be useful in many other scenarios too, so why restrict it? Processing directories recursively is something i run into quite often actually, and not always on the command line. If he could offer a module interface to it as well, I know I would find it alot more useful. But hey, this is all just my opinion.

      - stvn

        Yeah, but there are already about ten thousand modules out there for recursing through directories that we can use within programs. Why would we need another one?