Skip to content

Instantly share code, notes, and snippets.

@masak
Created February 1, 2011 11:05
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 masak/805717 to your computer and use it in GitHub Desktop.
Save masak/805717 to your computer and use it in GitHub Desktop.
exporting a sub
$ cat A.pm
use strict;
use warnings;
package A;
use base 'Exporter';
our @EXPORT = qw/foo/;
sub foo {
print "OH HAI\n";
}
$ cat test
use strict;
use warnings;
use lib '.';
use A;
foo();
$ perl test
OH HAI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment