in reply to Using Exporter with a complex hash
Lexical (my) variables cannot be exported. Only package (our) variables can. But please do heed the following warning found in the Exporter documentation:
"There's one more item to add to this list. Do not export variable names. Just because "Exporter" lets you do that, it does not mean you should.
@EXPORT_OK = qw( $svar @avar %hvar ); # DON'T!"Exporting variables is not a good idea. They can change under the hood, provoking horrible effects at-a-distance, that are too hard to track and to fix. Trust me: they are not worth it.
"To provide the capability to set/get class-wide settings, it is best instead to provide accessors as subroutines or class methods instead."
|
|---|