Quote:
Originally Posted by Scorpious2k
Is there a way to use a function in perl that refers to one in parser.cpp and have parser return a value to perl?
|
None of the currently exported functions return values.
Quote:
For example: quest::say(" I have $somestuff("1234")");
|
Not valid Perl. Functions aren't prefixed w/ $. Variables are never indexed w/ ().
Quote:
Have somestuff pass 1234 to a routine in parser, which does something with it and returns a value to perl, say "5678", and have perl then pass "I have 5678" to say?
|
I think that you're asking me how to write c code that you can call from perl embedded inside c code. My gut reaction is to tell you to rethink your strategy. Since you probably have some valid reason for investigating the possibility, though, I will also suggest that you look into xs. Be warned, though... writing xsubs is about as much fun as being repeatedly poked in the eye with a dirty finger.
Quote:
One case like this is $itemcount, which I am told doesn't work.
|
First I've heard of it. $itemcount is just a hash (read - variable) that gets preloaded before an event_item message. Control flow doesn't change upon accessing its contents.
Quote:
Also I was thinking it would be nice to have an $itemlink which would let you put a link to an item in a say/shout/me/emote....
|
I can see how that could be useful. Since I'd rather be gored by 1000 flaming bulls than write xs, I'd probably look into hooking the sharedmem module directly from perl. I am under the impression that it is exactly the purpose that the sharedmem lib is meant for.