From 2009ec81c3cc790cbdc42082c459cf57bdccedad Mon Sep 17 00:00:00 2001 From: Simon Cozens Date: Thu, 1 Apr 2004 16:19:02 +0000 Subject: [PATCH] Refactor out path parsing. git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@102 48953598-375a-da11-a14b-00016c27c3ee --- lib/Maypole.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/Maypole.pm b/lib/Maypole.pm index 20a3c0e..fd11fbe 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -118,6 +118,16 @@ sub additional_data {} sub authenticate { return OK } +sub parse_path { + my $self = shift; + $self->{path} ||= "frontpage"; + my @pi = split /\//, $self->{path}; + shift @pi while @pi and !$pi[0]; + $self->{table} = shift @pi; + $self->{action} = shift @pi; + $self->{args} = \@pi; +} + =head1 NAME Maypole - MVC web application framework -- 2.39.5