Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: Variable Scope

by jdporter (Canon)
on Oct 10, 2013 at 00:39 UTC ( #1057647=note: print w/ replies, xml ) Need Help??

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:

I reckon we are the only monastery ever to have a dungeon stuffed with 16,000 zombies.

Comment on Re: Variable Scope
Download Code
Replies are listed 'Best First'.
Re^2: Variable Scope
by DanielSpaniel (Scribe) on Oct 10, 2013 at 01:41 UTC

    Ah, thank you so much. Yes, I've now tried that and it works as expected.

    Many thanks!!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1057647]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2015-11-28 13:29 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (742 votes), past polls