Skip Menu |

This queue is for tickets about the File-Path CPAN distribution.

Report information
The Basics
Id: 46422
Status: resolved
Worked: 10 min
Priority: 0/
Queue: File-Path

People
Owner: dland [...] cpan.org
Requestors: warren.l.dodge [...] tek.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.07
Fixed in: (no value)



Subject: eval {mkpath("/ggg"} ; seems to not set $@
I downloaded and instaslled the 2.07 version into perl-5.10.0 I am using File::Path on a gnu/linux Redhat 4 system. I see when I make a path that is illegal using the eval trapping it doesn't seem to do what the man page says it does. Am I missing something? I hope you can help with this. Thanks. perl5.10.0 -dw ^d DB<1> use File::Path DB<2> eval { mkpath("/y/u/i") }; DB<3> x $@ 0 '' DB<4> mkpath("/y/t/r/e") mkdir /y: Permission denied at (eval 43)[/tools/wdtgnu/perl-5.8.5/lib/5.8.5/perl5db.pl:620] line 2 DB<5> q mkdir /y/u/i mkdir: cannot create directory `/y/u/i': No such file or directory
On Wed May 27 16:41:53 2009, warrendodge wrote: Show quoted text
> I downloaded and instaslled the 2.07 version into perl-5.10.0 > > I am using File::Path on a gnu/linux Redhat 4 system. I see when I make > a path that is illegal using the eval trapping it doesn't seem to do > what the man page says it does. > > Am I missing something?
Yes, mkpath() never dies. That would be drastic, to say the least! The traditional interface of mk_path() simply spewed out a message to stderr. Since that is not always very helpful, the new interface captures all the errors that may occur, and stores them in an error variable that you may process as you see fit. % perl -MFile::Path -e 'mkpath("/a/b/c", 0)' mkdir /a: Permission denied at -e line 1 % perl -MData::Dumper -MFile::Path -e 'File::Path::make_path("/a/b/c", {error=>\my $e}); print Dumper($e)' $VAR1 = [ { '/a' => 'Permission denied' }, { '/a/b' => 'No such file or directory' }, { '/a/b/c' => 'No such file or directory' } ]; Show quoted text
> I hope you can help with this. Thanks.
Hope that clears up the matter for you. Thanks for writing, regards, David Landgren