Created
August 9, 2020 01:39
-
-
Save exodist/618cbb47be4895273b8a66049b2fbfa0 to your computer and use it in GitHub Desktop.
why?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!perl xxx.pl | |
Can xxx() | |
Undefined subroutine &main::xxx called at xxx.pl line 10. | |
Undefined subroutine &main::xxx called at xxx.pl line 11. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
sub xxx { 1 } | |
undef(&xxx); | |
print __PACKAGE__->can("xxx") ? "Can xxx()\n" : "Cannot xxx()\n"; | |
eval { xxx(); 1 } or warn $@; | |
eval { __PACKAGE__->xxx(); 1 } or warn $@; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment