Created
June 9, 2012 18:03
-
-
Save berekuk/2901998 to your computer and use it in GitHub Desktop.
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 -e 'use autodie; sub read {}' | |
Prototype mismatch: sub main::read (*\$$;$) vs none at -e line 1. | |
$ perl -e 'use autodie; BEGIN { undef *read }; sub read {}' | |
# this one works... | |
# but it breaks if I use it in module: | |
$ cat >X.pm | |
use autodie; | |
BEGIN { undef *read } | |
sub read {} | |
1; | |
$ perl -e 'use X; X::read()' | |
Undefined subroutine &X::read called at -e line 1. | |
# autodie doesn't support '!' syntax from Exporter: | |
$ perl -e 'use autodie qw(!read); sub read {}' | |
Prototype mismatch: sub main::read (*\$$;$) vs none at -e line 1. | |
# Other options: | |
# 1) wrapping read() in 'no strict' | |
# 2) explicitly listing all functions I need | |
# 3) renaming my read() method | |
# But I don't like any of them. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment