Joe Landman wrote:
> Solution... see below ...
>   
> The hint I needed was that the regex'es are passed in via
> $c->request->snippets.  This controller definition works nicely.
>
> sub base : Regex('^directory(.*)$') {
>     my ( $self, $c ) = @_;
>     my ($rest);
>
>     $rest     = @{$c->request->snippets}[0];
>     ....
> }
>
> Would localregex eliminate the need to hardwire the "directory" in
> there?  Will play with this...
>   
Yes, but you still don't need to use a regex action.

sub base :Path {
  my ($self, $c, @parts) = @_;
  my $rest = join('/', @parts);
  ...
}

If you're using a Regex action, always first ask yourself "is there an 
easier way to do this?". The answer is almost always yes.

_______________________________________________
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/

Reply via email to