in reply to Creating Directories

Perl also has a built-in mkdir command. I like File::Path's mkpath function. If you use those, especially in combination with File::Spec's catdir and catfile, you won't have to worry about path separators.

Life's way too short to spend escaping backslashes.

Replies are listed 'Best First'.
Re: Re: Creating Directories
by barbie (Deacon) on Jun 13, 2003 at 12:09 UTC
    I am a recent convert to File::Path, especially on Windows. Unfortunately the Explorer process quite often hangs on my box, due to the excessive stuff it does under the hood. Using mkpath, Perl does it all quickly with no fuss.

    The added benefit is that you can call mkpath as:

    mkpath('c:\blah/blah/blah.pl');
    and it will just do the right thing. Nice :)

    --
    Barbie | Birmingham Perl Mongers | http://birmingham.pm.org/