Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Re: Embedded Perl Global Variables

by blssu (Pilgrim)
on Oct 07, 2003 at 01:17 UTC ( #297136=note: print w/replies, xml ) Need Help??

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).

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (1)
As of 2021-10-17 01:30 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (70 votes). Check out past polls.