From: Colin Meyer Date: Sun, 3 Mar 2002 14:54:24 +0000 (-0800) Subject: File::Path documentation X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=070ed4611e2512e7f027c985566ea59b2621cd8f;p=p5sagit%2Fp5-mst-13.2.git File::Path documentation Message-Id: <20020303145424.A21774@hobart.helvella.org> p4raw-id: //depot/perl@14975 --- diff --git a/lib/File/Path.pm b/lib/File/Path.pm index 10ae398..ffc077f 100644 --- a/lib/File/Path.pm +++ b/lib/File/Path.pm @@ -40,6 +40,15 @@ the numeric mode to use when creating the directories It returns a list of all directories (including intermediates, determined using the Unix '/' separator) created. +If a system error prevents a directory from being created, then the +C function throws a fatal error with Perl's C mechanism. +This error can be trapped with an C block: + + eval { mkpath($dir) }; + if ($@) { + print "Couldn't create $dir: $@"; + } + Similarly, the C function provides a convenient way to delete a subtree from the directory structure, much like the Unix command C. C takes three arguments: