anonsub.t: Improve test for [perl #71154]
authorFather Chrysostomos <sprout@cpan.org>
Sun, 8 Jul 2012 06:28:35 +0000 (23:28 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 8 Jul 2012 07:24:11 +0000 (00:24 -0700)
commit12f98b43fb8a44e8dfde5d99489b6a599bb91908
tree9bc1b7894d70be4542c7f51f1a14f5f009128ea7
parentaca88b25b97396281535603636c5ed7d71892870
anonsub.t: Improve test for [perl #71154]

When I authored commit 2c3743704, I thought I was just correcting the
error message at the time (from ‘Not a CODE reference’ to ‘Undefined
sub called’, since there is a sub), but it turns out I actually fixed
another bug at the same time.  Undefined anonymous subs were falling
back to supposedly-autoloaded __ANON__ subs.

Take this example, for instance:

    sub __ANON__ { warn 42 }
    $x = sub {};
    undef &$x;
    $x->();

This is the output I get:

$ pbpaste|perl5.14.0
42 at - line 1.
$ pbpaste|perl5.16.0
Undefined subroutine called at - line 4.
t/op/anonsub.t