in reply to Re: Re: Calling a sub in a Module
in thread Calling a sub in a Module
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Calling a sub in a Module
by chromatic (Archbishop) on Oct 23, 2002 at 18:19 UTC |