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;
};
That's ugly, but it works. Now, does anyone know how to make Path::Class evaluate
without URI... (Score:1)
If action_namespace doesn't start with '/':
Re: (Score:1)