Package declarations - noneYou need a package declaration of Book::Reader otherwise getData() will live in the main package. Also if you want to export methods in the current package you don't need to put an ampersand (&) before the name1, and @ISA and @EXPORT need to be package level variables e.g
package Book::Reader; require Exporter; @ISA = qw( Exporter ); @EXPORT = qw( getData ); use strict; sub getData { ... }
_________
broquaint
1 as chromatic notes in his node Exporter will treat &sub the same as sub in the @EXPORT list
In reply to Re: Re: Re: Calling a sub in a Module
by broquaint
in thread Calling a sub in a Module
by Tanalis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |