Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: Share Variable in Script with a Module

by tangent (Parson)
on Oct 10, 2013 at 14:52 UTC ( [id://1057742]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Share Variable in Script with a Module
in thread Share Variable in Script with a Module

By defining an import method in your module you are overriding Exporter's own import method so it never gets called and doesn't export your list. To fix that, add the following line:
sub import { my_testmodule->export_to_level(1, @_); my $class = shift; $gMessage = shift; print "Yep, I'm in here ...\n\n"; my_sub(); }
See the Exporter module's documentation for more.

Replies are listed 'Best First'.
Re^4: Share Variable in Script with a Module
by DanielSpaniel (Scribe) on Oct 10, 2013 at 15:02 UTC

    Thank you very much.

    In fact, I did re-post as a new question, because I figured that this original thread was too far down the list to get any attention, but I received the same answer on each, and it works great now.

    Thank you again.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2024-04-18 15:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found