package MyPackage;
use base qw( Exporter );
@EXPORT = qw( foo );
# create subroutines and export them
BEGIN{
for my $sub_name ( qw( bar baz ) ){
*$sub_name = sub { print $sub_name };
push @EXPORT, $sub_name;
}
}
# define a static subroutine for comparison
sub foo { print 'foo' }
1;
####
#!perl
use lib '.';
use MyPackage;
foo(); # prints 'foo'
MyPackage::bar(); # prints 'bar'
bar(); # Generates compile-time warning:
# Undefined subroutine &main::bar called at export.pl line 7.
####
perl -e 'split//,q{john hurl, pest caretaker}and(map{print @_[$_]}(join(q{},map{sprintf(qq{%010u},$_)}(2**2*307*4993,5*101*641*5261,7*59*79*36997,13*17*71*45131,3**2*67*89*167*181))=~/\d{2}/g));'