X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FFile%2FPath.pm;h=46af24fdb2027caf70084a79e989ba8dae84bd23;hb=35c0985d87e203a100f5c5fc6518bee6a2e2fd9d;hp=10ae398b67688f56c983da7d8672ba0767aaa1aa;hpb=7068481feb3366fc94b17a90a2eed90f87afc5a0;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/File/Path.pm b/lib/File/Path.pm index 10ae398..46af24f 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 C. 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: