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";
In reply to Re: problem referencing global variable in self-written module
by crashtest
in thread problem referencing global variable in self-written module
by yburge
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |