[Bps-public-commit] r15435 - in Path-Dispatcher/trunk: lib/Path

sartak at bestpractical.com sartak at bestpractical.com
Mon Aug 25 16:12:42 EDT 2008


Author: sartak
Date: Mon Aug 25 16:12:38 2008
New Revision: 15435

Modified:
   Path-Dispatcher/trunk/   (props changed)
   Path-Dispatcher/trunk/lib/Path/Dispatcher.pm

Log:
 r70291 at onn:  sartak | 2008-08-25 14:36:43 -0400
 Be more helpful in "use Path::Dispatcher 'foo'"


Modified: Path-Dispatcher/trunk/lib/Path/Dispatcher.pm
==============================================================================
--- Path-Dispatcher/trunk/lib/Path/Dispatcher.pm	(original)
+++ Path-Dispatcher/trunk/lib/Path/Dispatcher.pm	Mon Aug 25 16:12:38 2008
@@ -138,11 +138,14 @@
 sub begin_stage {}
 sub end_stage {}
 
+# We don't export anything, so if they request something, then try to error
+# helpfully
 sub import {
-    my $self = shift;
+    my $self    = shift;
+    my $package = caller;
 
     if (@_) {
-        Carp::croak "use Path::Dispatcher (@_) called. Did you mean Path::Dispatcher::Declarative?";
+        Carp::croak "use Path::Dispatcher (@_) called by $package. Did you mean Path::Dispatcher::Declarative?";
     }
 }
 



More information about the Bps-public-commit mailing list