[Catalyst-commits] r11662 -
Catalyst-Plugin-Static-Simple/trunk/lib/Catalyst/Plugin/Static
dnm at dev.catalyst.perl.org
dnm at dev.catalyst.perl.org
Thu Oct 22 19:21:27 GMT 2009
Author: dnm
Date: 2009-10-22 19:21:26 +0000 (Thu, 22 Oct 2009)
New Revision: 11662
Modified:
Catalyst-Plugin-Static-Simple/trunk/lib/Catalyst/Plugin/Static/Simple.pm
Log:
Moving code around so $@ is only checked if eval is called, since it currently
can get values from lingering old $@s.
Modified: Catalyst-Plugin-Static-Simple/trunk/lib/Catalyst/Plugin/Static/Simple.pm
===================================================================
--- Catalyst-Plugin-Static-Simple/trunk/lib/Catalyst/Plugin/Static/Simple.pm 2009-10-21 13:19:59 UTC (rev 11661)
+++ Catalyst-Plugin-Static-Simple/trunk/lib/Catalyst/Plugin/Static/Simple.pm 2009-10-22 19:21:26 UTC (rev 11662)
@@ -27,10 +27,19 @@
# strip trailing slashes, they'll be added in our regex
$dir_re =~ s{/$}{};
- my $re = ( $dir =~ m{^qr/}xms ) ? eval $dir : qr{^${dir_re}/};
- if ($@) {
- $c->error( "Error compiling static dir regex '$dir': $@" );
+ my $re;
+
+ if ( $dir =~ m{^qr/}xms ) {
+ $re = eval $dir;
+
+ if ($@) {
+ $c->error( "Error compiling static dir regex '$dir': $@" );
+ }
}
+ else {
+ $re = qr{^${dir_re}/};
+ }
+
if ( $path =~ $re ) {
if ( $c->_locate_static_file( $path, 1 ) ) {
$c->_debug_msg( 'from static directory' )
More information about the Catalyst-commits
mailing list