http://www.perlmonks.org?node_id=576212


in reply to Re: browser interface for local script
in thread browser interface for local script

Thanks, I used the following code:
sub handle_request { my ($self, $cgi) = @_; my $action = $cgi->path_info(); $action =~ s|^/||; # ensure action exists or set it to default if(! $self->can($action)) { $action = "home"; } $self->$action($self, $cgi); #print $out Dumper(%ENV); }
It is pretty neat. This makes it easy to use the MVC design pattern. I use HTML::Template to print all the pages out.