Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re^6: Exporter Problem

by Anonymous Monk
on Feb 23, 2013 at 03:06 UTC ( #1020270=note: print w/ replies, xml ) Need Help??

in reply to Re^5: Exporter Problem
in thread Exporter Problem

Rob, But if you load your module in a file containing:

use MyPackage ;
then it fails with:
Can't locate object method "new" via package "FOO::Soldier" at line 7.
Compilation failed in require at line 3.
BEGIN failed--compilation aborted at line 3.
One or more DATA sections were not processed by Inline.
I think this has to do with the eval'd INIT block in around line 200. I think it runs at "run" time, while all the "use" stuff runs at compile time. So it's basically not run yet. If you call:
Inline->init() ;
just before creating the FOO::Solfier objects it will fix the problem. Patrick

Comment on Re^6: Exporter Problem
Select or Download Code
Replies are listed 'Best First'.
Re^7: Exporter Problem
by syphilis (Chancellor) on Feb 23, 2013 at 10:12 UTC
    Hi Patrick,
    Yes, I now recall this Inline->init(); trick having cropped up before - though I can't quite recall the context.

    I had the impression from earlier postings in this thread that, wrt Inline::Java, it wasn't necessary to load a to strike the problem. Instead it was enough to merely load the Inline::Java module into another namespace (as per my Inline::C demo).
    Perhaps that's not so - I don't currently have Inline::Java installed and therefore can't check that for myself.

    Anyway, if Inline::C and Inline::Java aren't in exactly the same boat here, it looks like they're at least part of the same fleet ;-)

    Hopefully Inline->init(); will solve the OP's problems.
    Thanks for chiming in, Patrick !

Re^7: Exporter Problem
by osler (Sexton) on Feb 25, 2013 at 01:52 UTC
    Worked perfectly, thanks!!!!!

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (11)
As of 2015-12-01 16:08 GMT
Find Nodes?
    Voting Booth?

    My keyboard shows this many letters:

    Results (18 votes), past polls