julien CLEMENT | 1 Dec 17:38

Perl Export (2)

Hi all,

I'm new to SWIG. I'm using it to interface Perl and C.
I've noticed that the generated .pm did not export the symbols:

<at> EXPORT = qw ();

Thus, it forces a client program to prefix each symbol with the name of the package or
to do a "pakage <name>;"
If a program uses more than one package, it can be messy to switch between the namespaces.

Is there a way to force the export of the Perl symbols in the generated .pm ?

Many thanks
Julien CLEMENT.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Swig-user mailing list
Swig-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
Josh Cherry | 1 Dec 17:47
Favicon

Re: Perl Export (2)


On Mon, 1 Dec 2008, julien CLEMENT wrote:

> I'm new to SWIG. I'm using it to interface Perl and C.
> I've noticed that the generated .pm did not export the symbols:
>
> @EXPORT = qw ();
>
> Thus, it forces a client program to prefix each symbol with the name of the package or
> to do a "pakage <name>;"
> If a program uses more than one package, it can be messy to switch between the namespaces.
>
> Is there a way to force the export of the Perl symbols in the generated .pm ?

You can add any Perl code you like by using %perlcode (see the Perl 
section of the manual).

Josh

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

Gmane