Skip to content

Instantly share code, notes, and snippets.

@berekuk
Created June 9, 2012 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save berekuk/2901998 to your computer and use it in GitHub Desktop.
Save berekuk/2901998 to your computer and use it in GitHub Desktop.
$ 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