Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: import doesn't work at runtime?

by johnny_carlos (Scribe)
on Nov 11, 2011 at 21:56 UTC ( [id://937674]=note: print w/replies, xml ) Need Help??


in reply to import doesn't work at runtime?

It works for me when adding parens to the subroutines:
require MyModule; MyModule->import( qw(frobnicate munge) ); frobnicate(); munge();

Replies are listed 'Best First'.
Re^2: import doesn't work at runtime?
by gdave (Novice) on Nov 11, 2011 at 22:08 UTC
    aha! &frobnicate and &munge also do the trick. I think I get it now, thanks.

      Yes, part of the consequence of having & is to identify a word as being a function name. However, there are other consequences. If you don't know what those consequences are, avoid using &.

      As Occam said: Entia non sunt multiplicanda praeter necessitatem.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2024-04-24 09:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found