MMGM has asked for the wisdom of the Perl Monks concerning the following question:

Is there anyway to get the rmdir() command to perform a recursive delete/rmdir? I know I can write a routine fairly easy to do this or use the system() command for rmdir with the "/s /q" flags. However, I was under the impression that the PERL rmdir() will map to the rmdir() OS system function. Since the parameter options are there for the OS command, I was hoping there'd be a way to invoke them. Thanks, -MMGM

Replies are listed 'Best First'.
(boo)Re: win32 PERL rmdir()
by boo_radley (Parson) on Mar 15, 2001 at 21:22 UTC
    rmdir does one directory at a time.
    However, File::Path has exactly what you're looking for : rmtree.
    If that doesn't suit your needs, there's File::Find, which would help you in crafting a rmtree of your own -- File::Find just recurses through files/ directories.
    If that, for whatever reason doesn't work, you'll probably wind up crafting your own -- a dangerous path fraught with accidentally deleted files or directories ;)
    update Actually, be careful with all of them. woes of deleted files are your own fault. I am blameless and without sin.

    update Made tye happy.