[Dancer-users] Undocumented bug or feature

sawyer x xsawyerx at gmail.com
Thu Jun 23 14:26:33 CEST 2011


Hi Oleg!

Thank you for noting this. I will hopefully push a new implementation of the
entire path()s layer we have this weekend, and this will incorporate what
you mentioned.

On Wed, Jun 22, 2011 at 10:12 PM, Oleg A. Mamontov <oleg at mamontov.net>wrote:

> Hello!
>
> Dancer manual (pod) tells us about `path` function:
> "Concatenates multiple paths together, without worrying about the
> underlying operating system".
>
> But unfortunately this isn't true :(
> In reality &Dancer::path is &File::Spec::catfile wrapped by &Cwd::realpath.
>
> And &Cwd::realpath is worked with BSD realpath (3) semantic:
> "All but the last component of a pathname must exist when realpath() is
> called."
>
> Assume that '/tmp' directory is exists and empty.
> Then this Dancer application code:
>
>  my $x = path "/tmp","nonexistent";
>  my $y = path "/tmp","nonexistent","foo";
>
> will assign "/tmp/nonexistent" to $x, but undef to $y.
>
> This behavior may be slightly unexpected :)
> So if you create variable with nonexistence path you may get defined or
> undefined string
> depending on missing subdirectories number.
>
> I am not sure what's the best, but (imho) ones should be fixed: Dancer pod
> or Dancer::path :)
>
> --
> Cheers,
> Oleg A. Mamontov
>
> mailto:  oleg at mamontov.net
>
> jabber:  lonerr at charla.mamontov.net
> icq uin: 79-521-617
> cell:    +7-903-798-1352
>
> _______________________________________________
> Dancer-users mailing list
> Dancer-users at perldancer.org
> http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20110623/ad8204ad/attachment.htm>


More information about the Dancer-users mailing list