In deprecate.pm, only cluck() once if the leaf isn't found in the caller stack.
authorNicholas Clark <nick@ccl4.org>
Fri, 18 Feb 2011 16:15:24 +0000 (16:15 +0000)
committerNicholas Clark <nick@ccl4.org>
Fri, 18 Feb 2011 18:21:12 +0000 (18:21 +0000)
Previously, if the expected leafname was not found in the caller stack, the
code was cluck, and then continue the loop with the next directories to scan.
However, this serves no useful purpose, as the loop changes nothing that causes
the failure condition, hence all that this would result in is a second cluck()
if the next scanned directories also happened to match. Now the core returns
immediately.

lib/deprecate.pm

index b5f1793..9afa3dc 100644 (file)
@@ -34,7 +34,7 @@ sub import {
                Carp::cluck(<<"EOM");
 Can't find use/require $expect_leaf in caller stack
 EOM
-               next;
+               return;
            }
 
            # This is fragile, because it