> -----Original Message-----
> From: Anthony Skjellum [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 21, 2005 8:58 PM
> To: inline@perl.org
> Subject: Inlined Perl in a module
> 
> 
> We are using Inline Java v. 0.49 and have the
> following situation:
> 
> # in mainprog.pl
> 
> use ourmod;
> 
> # this works:
> my $obj = ourmod::zephyr->new(55);
> 
> # this doesn't resolve; Java.pm can't find the
> #prototype for the constructor mapped to Java:
> my $obj = zephyr->new(55);

This is trying to call the new() method in a package called 'zephyr'.  There is 
no such package in your code.  Perl's packages aren't nested in any way, 
they're absolute.

If you do "*zephyr = *ourmod::zephyr;", then you'll alias the entire package 
into the current namespace, which is probably something like what you want.  If 
so, then you could do this in an import() method in ourmod.pm, using caller() 
to figure out the target package for the alias.

 -Ken

Reply via email to