At 12:00 PM +0930 8/30/04, Jeremy Begg wrote: > The Perl documentation for unlink() says that it >shouldn't be used to delete directory files (presumably because Unix handles >them very differently to normal files). Is this also true for VMS Perl? >(Obviously deleting a .DIR;1 file in VMS without first deleting any files in >the directory is not ideal, but it doesn't break the filesystem.)
I don't know of any reason deleting directories with Perl would have any caveats you wouldn't also have deleting them any other way. Perl_kill_file calls the CRTL remove() function, which probably calls lib$delete_file. If what you want is to delete a whole directory tree regardless of whether there are files, subdirectories, etc., then have a look at File::Path::rmtree. One-liners like the following can be quite handy (though I generally use DFU for this purpose): $ perl -e "use File::Path; rmtree([EMAIL PROTECTED],1,0);" [.stuff_to_kill] -- ________________________________________ Craig A. Berry mailto:[EMAIL PROTECTED] "... getting out of a sonnet is much more difficult than getting in." Brad Leithauser
