Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Maintainer(s)' notes

I prefer that bugs & patches are filed on GitHub rather than on RT: Thanks.

Report information
The Basics
Id: 83203
Status: open
Priority: 0/
Queue: Path-Class

Owner: Nobody in particular
Requestors: dagolden [...]

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

Subject: parent incorrect with trailing updir
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 329
Download (untitled) / with headers
text/plain 329b
It looks like parent for dir() is just truncating a piece, which is incorrect if the last entry is "..". It should append another ".." instead, I believe. $ perl -MPath::Class -wE '$f=dir("/foo/bar/.."); $p = $f->parent; say $p' /foo/bar FWIW: This is perl 5, version 16, subversion 1 (v5.16.1) built for darwin-2level
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-2629-1360279322-165.83203-0-0 [...]>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 246
Download (untitled) / with headers
text/plain 246b
That's an interesting question. I'm not so sure that's what it should do, arguably the parent of '/foo/bar/..' is indeed '/foo/bar', at least if one follows the Unix directory links. Are there practical issues suggesting one way or the other?
From david [...] Thu Feb 7 18: 39:47 2013
MIME-Version: 1.0
X-Spam-Status: No, score=-6.697 tagged_above=-99.9 required=10 tests=[AWL=0.203, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_HI=-5] autolearn=ham
In-Reply-To: <rt-3.8.HEAD-2629-1360279323-999.83203-6-0 [...]>
X-Spam-Flag: NO
References: <RT-Ticket-83203 [...]> <rt-3.8.HEAD-2629-1360279323-999.83203-6-0 [...]>
X-Virus-Scanned: Debian amavisd-new at
X-Received: by with SMTP id du32mr286947qcb.82.1360280377316; Thu, 07 Feb 2013 15:39:37 -0800 (PST)
Message-ID: <CAOeq1c_EtKN+UCixHfS-=P25n+oMUrqjESKyKAU6Unu-i_qu8w [...]>
Content-Type: text/plain; charset=UTF-8
X-RT-Original-Encoding: utf-8
X-Spam-Score: -6.697
Authentication-Results: (amavisd-new); dkim=pass header.i= [...]
Received: from localhost (localhost []) by (Postfix) with ESMTP id 41E8F2405BB for <cpan-bug+Path-Class [...]>; Thu, 7 Feb 2013 18:39:47 -0500 (EST)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id Z9BNlKfLnDeV for <cpan-bug+Path-Class [...]>; Thu, 7 Feb 2013 18:39:45 -0500 (EST)
Received: from ( []) by (Postfix) with SMTP id 08FE02405BA for <bug-Path-Class [...]>; Thu, 7 Feb 2013 18:39:44 -0500 (EST)
Received: (qmail 5201 invoked by uid 103); 7 Feb 2013 23:39:43 -0000
Received: from ( by with QMQP; 7 Feb 2013 23:39:43 -0000
Received: from (HELO ( by (qpsmtpd/0.84/v0.84-167-g4ed6cab) with ESMTP; Thu, 07 Feb 2013 15:39:40 -0800
Received: by with SMTP id cr7so85869qab.17 for <bug-Path-Class [...]>; Thu, 07 Feb 2013 15:39:37 -0800 (PST)
Received: by with HTTP; Thu, 7 Feb 2013 15:39:07 -0800 (PST)
Delivered-To: cpan-bug+Path-Class [...]
Subject: Re: [ #83203] parent incorrect with trailing updir
Return-Path: <david [...]>
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=google; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding; bh=MstN/LdK2PXZGavsjnwgDtt1KHgHqf6J9GiWIQX53iE=; b=djgKyT3Vmf2zwN8lqYmLvGz4FB/1qnDjSWZ91mLcNwLYHYn4RIExcVKt4HBYhETGIj 9j3vbnozh29wBeTOr1vFgZ2mjUb0NCIgK6ny1C1gVZ8Ew7aOT5w+6X7LoC7ViXUscj7I jKh8SwaM/dd/jhv32ePhuDWeDy/c9RcZ2tlTg=
X-Original-To: cpan-bug+Path-Class [...]
X-RT-Mail-Extension: path-class
X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding:x-gm-message-state; bh=MstN/LdK2PXZGavsjnwgDtt1KHgHqf6J9GiWIQX53iE=; b=p3CQfCy1Wpf2IAgBsD/aPQbAfjtO+xs2tDoKzQSZlQD2W6icXGKh4GcfEH+xBkp6cH U2KsUnstcuyvpdRiBN+Z790i3CEMdi0w/Wvt+HUHvCncniOs5KR2BGtrrCr6cgx1YGJy ypw2GTi5w3U7xM2kBeI2CVXKxeZ+yeaJfAlG4N1SmvmbjgfI/N1KXq2q/e975HR6iayP L8PhW52v79WIi2v9gOlvxUOztbo0KP+DNqEZPRK5Iuadba5OoI6+bqdsphy99WTWRnth V+hWAhOrO5tPcHTFmluSIulU1LMTos+IxOSQc0rAXWwtQ7g67Sg6aAnfdDyoj14rIa7X 5Zlw==
X-Google-Sender-Auth: M-Vs8IlyPJDwdWl3XRCSPnMgbz8
Sender: david [...]
Date: Thu, 7 Feb 2013 18:39:07 -0500
To: bug-Path-Class [...]
Content-Transfer-Encoding: quoted-printable
From: David Golden <dagolden [...]>
X-GM-Message-State: ALoCoQmaNo+BgRkcyQYVn+e6yGYcL4ux6QrGx9tMudW8KRzWE5cKsS/jx8uliDhZGE8oBUAUH6CD
RT-Message-ID: <rt-3.8.HEAD-18727-1360280388-116.83203-0-0 [...]>
Content-Length: 861
Download (untitled) / with headers
text/plain 861b
On Thu, Feb 7, 2013 at 6:22 PM, Ken Williams via RT <> wrote: Show quoted text
> That's an interesting question. I'm not so sure that's what it should do, > arguably the parent of '/foo/bar/..' is indeed '/foo/bar', at least if one > follows the Unix directory links.
/foo/bar/.. is /foo as long as symlinks aren't in the picture. E.g. assuming /tmp/bar exists, then "mkdir /tmp/bar/../baz" from the shell will create /tmp/baz. I think dir("/foo/bar/..")->parent should be "/foo/bar/../..". If someone wants to sort out the updirs, they can call resolve, after all. It's probably relevant for something like dir("/foo/bar/../baz") -- if someone calls parent twice, they should get "/foo/bar/../.." not "/foo/bar" as they do now. David -- David Golden <> Take back your inbox! → Twitter/IRC: @xdg

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to