X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FPlugin%2FStatic%2FSimple.pm;h=6fec1e8de37d84f2685199e82f59076b1db6aa44;hb=b06be085e105a04155df9f3a2392b51c8789e6c8;hp=de6c229a53ab7ade0269d77986535a31575fc11f;hpb=d62f3c980c7196cbbe93567c7b7aa358e066924c;p=catagits%2FCatalyst-Plugin-Static-Simple.git diff --git a/lib/Catalyst/Plugin/Static/Simple.pm b/lib/Catalyst/Plugin/Static/Simple.pm index de6c229..6fec1e8 100644 --- a/lib/Catalyst/Plugin/Static/Simple.pm +++ b/lib/Catalyst/Plugin/Static/Simple.pm @@ -1,6 +1,7 @@ package Catalyst::Plugin::Static::Simple; use strict; +use warnings; use base qw/Class::Accessor::Fast Class::Data::Inheritable/; use File::stat; use MIME::Types; @@ -30,7 +31,7 @@ sub prepare_action { } if ( $path =~ $re ) { if ( $c->_locate_static_file ) { - $c->_debug_msg( "from static directory" ) + $c->_debug_msg( 'from static directory' ) if ( $c->config->{static}->{debug} ); return; } else { @@ -74,8 +75,8 @@ sub finalize { # display all log messages if ( $c->config->{static}->{debug} && scalar @{$c->_debug_msg} ) { - $c->log->debug( "Static::Simple: " . - join( " ", @{$c->_debug_msg} ) ); + $c->log->debug( 'Static::Simple: ' . + join q{ }, @{$c->_debug_msg} ); } if ( $c->res->status =~ /^(1\d\d|[23]04)$/xms ) { @@ -127,9 +128,9 @@ sub _locate_static_file { if ( ref $dir eq 'CODE' ) { eval { $dpaths = &$dir( $c ) }; if ($@) { - $c->log->error( "Static::Simple: include_path error: " . $@ ); + $c->log->error( 'Static::Simple: include_path error: ' . $@ ); } else { - unshift( @ipaths, @$dpaths ); + unshift @ipaths, @$dpaths; next DIR_CHECK; } } else { @@ -173,7 +174,7 @@ sub _serve_static { my $type = $c->_ext_to_type; my $full_path = $c->_static_file; - my $stat = stat( $full_path ); + my $stat = stat $full_path; # the below code all from C::P::Static if ( $c->req->headers->if_modified_since ) {