At 7:49 PM -0500 9/20/07, John E. Malmberg wrote: >Peter (Stig) Edwards wrote: >>Content of >> http://rt.cpan.org//Ticket/Display.html?id=29513 >>below: >> >> >>Hello and thanks for maintaining PathTools. >> >>The question/bug I have is: >>"What should File::Spec->canonpath() return?" >> >>On VMS (PathTools 3.17 and 3.25) I get undef: >> >>perl -e "use strict;use warnings;use File::Spec;print defined >>File::Spec->canonpath() ? 'def' : 'undef';" >>undef >> >>On UNIX (PathTools 3.23) I get empty string: >> >>perl -e "use strict;use warnings;use File::Spec;print defined >>File::Spec->canonpath() ? 'def' : 'undef';" >>def > >I would expect C<canonpath(undef)> to behave the same for both.
Agreed. >There is a problem on VMS if File::Spec->canonpath(undef) returns '', as VMS >will treat '' 'as SYS$DISK:[].;' which is likely to cause hard to detect >problems, Uh, what? A return statement that looks like C<return '';> does not return a string containing two single quote characters; it returns a zero-length string. I must be missing what you're saying somehow. >>Thanks for your thoughts on this. I got to this point from installing >>DBI 1.59 on VMS, and it calling catdir() with files as arguments and >>this causing warnings from the undefined value being returned from >>canonpath, example: If DBI is calling catdir when it should be calling catfile, please log a bug report against DBI as well. I'm pretty sure I've submitted patches against DBI's Makefile.PL at least once for that exact same problem. >catdir should not be called with a filename as an argument. The code should >use catfile. Exactly. -- ________________________________________ Craig A. Berry mailto:[EMAIL PROTECTED] "... getting out of a sonnet is much more difficult than getting in." Brad Leithauser