in reply to Variable Scope
The problem -- and it is admittedly a subtle one -- is that if your module isa Exporter, then the semantics of argument passing to the module is (re)defined by Exporter. As the docs clearly state, arguments you pass to the use of an Exporter-derived module are supposed to be the symbols you want to import from it.
Of course, you're not seeing the error that should occur because you're also re-defining import, rather than using the one provided by Exporter. The docs, at section "Exporting without using Exporter's import method", explain how to do what you're trying to do. In a nutshell, add the following line to your import sub:
$class->export_to_level(1,);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Variable Scope
by DanielSpaniel (Scribe) on Oct 10, 2013 at 01:41 UTC |