Created
February 1, 2011 11:05
-
-
Save masak/805717 to your computer and use it in GitHub Desktop.
exporting a sub
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
$ 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