Skip to content

Instantly share code, notes, and snippets.

@notbenh
Created October 5, 2011 04:15
Show Gist options
  • Save notbenh/1263615 to your computer and use it in GitHub Desktop.
Save notbenh/1263615 to your computer and use it in GitHub Desktop.
are prototypes exportable?
#!/usr/bin/env perl
use strict;
use warnings;
use Test::Most qw{no_plan};
BEGIN {
package My::Test;
use Exporter qw{import};
our @EXPORT = qw{thing};
sub thing ($) { shift };
};
My::Test->import();
can_ok q{main}, qw{ thing };
is thing 'that', 'that';
__END__
String found where operator expected at t.t line 16, near "thing 'that'"
(Do you need to predeclare thing?)
Not enough arguments for Test::More::is at t.t line 16, near "thing 'that'"
syntax error at t.t line 16, near "thing 'that'"
Execution of t.t aborted due to compilation errors.
# Looks like your test exited with 255 before it could output anything.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment