X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=61439c29e4989b204cdc166be87908a5df4a5b40;hb=b77837889755d5af814803443f7ab93a1655b71f;hp=55057e367f4af5cc6d9ecee387ccd3a1f49ab60d;hpb=0319a12c0c3fa73505117e1a02ad9e946614c59c;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 55057e3..61439c2 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -125,14 +125,19 @@ Returns a hashref containing your applications settings. sub import { my ( $class, @arguments ) = @_; + my $caller = caller(0); + + if ( $caller eq 'main' ) { + return; + } # Prepare inheritance unless ( $caller->isa($class) ) { no strict 'refs'; push @{"$caller\::ISA"}, $class; } - + if ( $caller->engine ) { $caller->log->warn( qq/Attempt to re-initialize "$caller"/ ); return; @@ -144,7 +149,7 @@ sub import { foreach (@arguments) { if ( /^-Debug$/ ) { - $flags->{log} = 1 + $flags->{log} = ( $flags->{log} ) ? 'debug,' . $flags->{log} : 'debug'; } elsif (/^-(\w+)=?(.*)$/) { $flags->{ lc $1 } = $2;