in reply to Re: Embedded Perl Global Variables
in thread Embedded Perl Global Variables

Sorry I didn't use a hash example like your problem. The code is very similar.

HV *hash = perl_get_hv("Some::Module::TestGlobal", 1)

See page 338 in Srinivasan or page 145 in Jenness/Cozens.

One thing I didn't mention is that you must create the hash as a global variable -- don't use newHV. It doesn't matter if you create the global before or after loading your modules. I normally load my modules and then fetch the variables they define.

If you use C++, you might find my libperl++ package helpful. It may be useful for code examples at any rate. Of course, as a recent thread points out, real perl hackers don't use C++... ;)

Replies are listed 'Best First'.
Re: Re: Re: Embedded Perl Global Variables
by Anonymous Monk on Oct 07, 2003 at 05:28 UTC

    Blssu - Thank you for the answers, and the libperl++ library. I used your first and second replys to solve all of the remaining issues in my code. I can actually get some sleep this evening!

    As you had guessed in your message, I was working on re-inventing the perl_get_hv() function (very much the hard way).