I have made major enhancements to the
Win32::MMF module after receiving execellent suggestions from several monks. The latest version has a built-in shared-memory and shared-variable management system, and I have designed the module to be as simple to use as possible. There is still improvements to be made, especially on how to handle a waiting-for-a-variable-to-come-alive situation more gracefully. So suggestions are welcome and greatly appreciated.
The following is the new look and feel of the OO interface:
use Win32::MMF;
# --- in process 1 ---
my $ns1 = Win32::MMF->new( -namespace => "MyData1" );
$ns1->setvar('varid', $data);
# --- in process 2 ---
my $ns2 = Win32::MMF->new( -namespace => "MyData1" );
while (!$ns2->findvar('varid')) {};
$data = $ns2->getvar('varid');