CC: | <dmuey [...] cpan.org> |
Subject: | Mismatch between perldoc and implemenation |
Date: | Wed, 21 Jan 2009 10:58:37 +0100 |
To: | <bug-File-Copy-Recursive [...] rt.cpan.org> |
From: | <FischerR.External [...] infineon.com> |
(This applies to File::Copy::Recursive version 0.36)
(1) From the perldoc:
pathmk()
Creates a given path recursively. Creates foo/bar/baz even if foo
does
not exist.
File::Copy::Recursive::pathmk('foo/bar/baz') or die $!;
An optional second argument if true acts just like
$File::Copy::Recursive::NoFtlPth, which means you'd never get your
die()
if something went wrong.
Here we have a contradiction. The example
pathmk('...') or die;
suggests that pathmk (when called with only one argument) returns false
on
failure, while the next sentence says that pathmk throws an exception on
failure. In fact, pathmk is *implemented* in that way that it returns
false
on failure, but does not throw an exception. I verified this on Windows
by
trying to create a path on a non existent drive:
perl -le "use File::Copy::Recursive qw(pathmk); pathmk('X:/foo/bar')
or print 'fail'"
prints "fail" - no die() executed.
(2) The perldoc also says:
AUTHOR
Daniel Muey, <http://drmuey.com/cpan_contact.pl>
This website does not exist (404 file not found)