I am new to Perl and I face following issue, having no clue why following is not working.
My Perl module contains:
package PACK2;
use Exporter;
@ISA = ('Exporter');
@EXPORT_OK=('whom');
sub why(){
print "why\n";
}
sub whom(){
print "whom\n";
}
1;
My Perl file contains:
#!/usr/bin/perl -w
use pack;
use pack2 ('whom');
PACK::who();
&whom();
I run this program and can't find whom
:
perl use_pack_pm.pl
who
Undefined subroutine &main::whom called at use_pack_pm.pl line 7.