On Mon, Jun 28, 2010 at 6:52 PM, Jonathan Swartz <swa...@pobox.com> wrote:
> Is there something like a File::AllUtils that uses and exports a bunch of
> standard file modules, for some definition of standard? If not, would it be
> reasonable for me to release one?
>
> I know about Path::Class, which is an interesting approach, but when I use
> it the stringification trips up just often enough to annoy me. I guess I
> either prefer or am used to the traditional Perl non-OO functions for file
> manipulation.

I have the same annoyance with Path::Class, but use it anyway and just
stringify religiously.  You might also see File::Fu, which does
something similar.

If you want to export all the functions from a set of modules, you can
easily whip that up using the ToolSet module.  Here is a module that
exports the same list you gave in your email:

     # My/Tools.pm
     package My::Tools;

     use base 'ToolSet';

     ToolSet->export(
         'Cwd' => 'realpath',        # get a specific function
         'File::Basename => undef,   # get the defaults
         'File::Path => undef,
         'File::Slurp => undef,
         'File::Spec::Functions => undef,
         'File::Temp' => undef,
     );

     1;

You can then just "use My::Tools" and you'll get all the usual stuff
you use. Hope that helps for a quick fix.

-- David

Reply via email to