in reply to problem referencing global variable in self-written module
Both replies so far explained how to use Exporter to export the $fleece variable into your main script. I thought I'd point out you don't have to do it that way: if you fix the code in the Fleece package as ikegami suggested (i.e., our $fleece = "..."), you can reference $fleece in your print statement by prefixing the package name:
No need for use Exporter, @EXPORT or @EXPORT_OK.print "Its fleece was $Fleece::fleece.\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: problem referencing global variable in self-written module
by yburge (Acolyte) on Jun 10, 2006 at 01:42 UTC | |
|
Re^2: problem referencing global variable in self-written module
by yburge (Acolyte) on Jun 13, 2006 at 21:25 UTC |