Subject: | strip convenience function |
Date: | Sun, 2 Jan 2011 20:10:51 -0600 |
To: | bugs-path-class [...] rt.cpan.org |
From: | Caleb Cushing <xenoterracide [...] gmail.com> |
my generalized problem is I have a Path::Class object with a path of
/foo/bar/baz . but I need to modify the path of the object to be
/bar/baz . It's been suggested that I create export the path to an
array, and then shift the first element off, and create a new object
from that array. This sounds like it will work but seems tedious. GNU
tar (yes I realize this isn't gnu tar) has an argument
--strip-components=N where N is the number of path components you want
to strip off the front. I'm not really sure if the API should be
$dir->strip(1); or something else. but it seems to me like that would
be much nicer than what's been suggested.
--
Caleb Cushing
http://xenoterracide.com