With mst pointing in the correct direction [as usual], this is a little hack I have to make Chained('../method') possible.
This is mostly for cases where I want to have Controller::Foo::Child chained off of Controller::Foo, but I feel naughty about hardcoding Chained('/foo/method') in Foo::Child, esp if both of those classes are subclasses, so the name can follow long.
sub _parse_Chained_attr { my ($self, $c, $name, $value) = @_;
if ($value && $value =~ /\.\.\//) { ## this is a friggin hack because I don't know how to have ## Path::Class eval ../ for me local $URI::ABS_REMOTE_LEADING_DOTS = 1; $value = URI->new( Path::Class::Dir->new($self->action_namespace, $value)->as_foreign('Unix')->stringify )->abs('http://localhost')->path; };
return Chained => $value || $self->action_namespace; };
$value=dir($value)->absolute($self->action_namespace)
->as_foreign('Unix')->stringify
If action_namespace doesn't start with '/':
$value=dir($value)->absolute(dir('',$self->action_namespace))
->relative(dir(''))->as_foreign('Unix')->stringify
Re:without URI...
jk2addict on 2008-01-11T23:45:27
Negatory. That code for me yields dirs that stll have../ in them.