in reply to Subroutines not exporting? Why?
I suspect you are using __END__where what you really meant was exit;.
So these two keywords have different functions:
Thus, your __END__is causing perlto stop reading the source code before it gets to the subroutine; the subroutine is therefore never compiled. During execution, it does not exist, hence the error.
So, if I'm guessing right about your intentions, the fix is fairly simple, as noted by everyone else on this thread:
package My::Util; use strict; use warnings; use Exporter; our @ISA = qw(Exporter); our @EXPORT = qw( get_file_name ); exit; sub get_file_name { ... } 1; __END__
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Subroutines not exporting? Why?
by Anonymous Monk on Jul 07, 2015 at 10:41 UTC | |
by marinersk (Priest) on Jul 07, 2015 at 13:12 UTC | |
by Anonymous Monk on Jul 07, 2015 at 19:10 UTC | |
by marinersk (Priest) on Jul 08, 2015 at 13:37 UTC |