iang has asked for the wisdom of the Perl Monks concerning the following question:
Calling Script test.plpackage Helper; use strict; use warnings; use Exporter qw(import); our @ISA = qw(Exporter); our @EXPORT = qw(foo); sub foo { print "foo\n"; } sub bar { print "bar\n"; } 1;
It does work if I prefix foo with the package name Helper::foo, but I was hoping to avoid that.#!/usr/bin/perl use strict; use warnings; use HELPER; print "In Main\n"; foo();
any help would be appreciated -- thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Export function from module
by davido (Cardinal) on Apr 30, 2013 at 02:48 UTC | |
by Anonymous Monk on Apr 30, 2013 at 03:39 UTC | |
by davido (Cardinal) on Apr 30, 2013 at 04:43 UTC | |
by 2teez (Vicar) on Apr 30, 2013 at 04:56 UTC |