X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2FCLI.pm;h=39abf1546370987a26f16fb00d57c584bf14b045;hb=2098a37df841aa1931e60787af007b34bd96f465;hp=3839521e2d8112e03bb8eb9971551a28f691843c;hpb=8617321ebf13ce6b63d41a65a003d153f2b5cc5e;p=maypole.git diff --git a/lib/Maypole/CLI.pm b/lib/Maypole/CLI.pm index 3839521..39abf15 100644 --- a/lib/Maypole/CLI.pm +++ b/lib/Maypole/CLI.pm @@ -26,9 +26,19 @@ sub import { sub get_template_root { $ENV{MAYPOLE_TEMPLATES} || "." } +sub warn { + my ($self,@args) = @_; + my ($package, $line) = (caller)[0,2]; + warn "[$package line $line] ", @args ; + return; +} + sub parse_location { my $self = shift; my $url = URI->new( shift @ARGV ); + + $self->preprocess_location(); + (my $uri_base = $self->config->uri_base) =~ s:/$::; my $root = URI->new( $uri_base )->path; $self->{path} = $url->path; @@ -47,7 +57,7 @@ sub send_output { $buffer = shift->{output} } sub call_url { my $self = shift; - @ARGV = @_; + local @ARGV = @_; $package->handler() == OK and return $buffer; } @@ -137,6 +147,8 @@ functionality. See L for these: =item send_output +=item warn + =back =cut