Advertisement

Embedded Perl in C++ - libperl++ tutorial

Started by February 20, 2005 10:53 AM
-1 comments, last by Genjix 20 years ago
sorry for double posting, but no one has answered my other thread.

google only turns upp 42 results for libperl++, and I cant find any resources on embedded perl in apps. All I want to do is this.


- call (code defined) functions in perl script
- call (code defined again) functions from within perl script
- casting to STL types (strings, vectors, hash maps), and able to
pass in STL types (or should i need to write wrappers for this?)

is there a simple page tutorial on these things?

i've been looking at the CPAN page and it looks like I may be forced into libperl++ types. Is this the case?

would i be able to do something like this? (where TGload_script would override init). Would I explicitly need to keep variables between reloading new perl scripts, or can I turn this off, doing the opposite (explicitly freeing variables)?

# TG prefixes, are game engine functions

sub init()
{
	if($a > 6)
	{
		$a = -1;		# kill $a
		TGload_scene("traitor_yunia.xml");

		# add game loop functions
		TGadd_proc("cut_in");	# ???????
	}
	else
	{
		TGload_script("quest.pl");
	}
}

sub cut_in()
{
	# handle various in game events
	$objcount = TGobject_count();

	if($objcount > 5)
	{
		TGprintscr("Wise Sage: Aeons passed...");
	}
}


This topic is closed to new replies.

Advertisement