[gme-users] Interfacing GME with Perl

Simon Görke simon.goerke at ils.uni-stuttgart.de
Fri Nov 30 08:33:48 CST 2007

Hi folks,

Does anybody have experience with interfacing GME and Perl using OLE?
We have been trying hard for some time but still experience problems with
certain commands.
As the same functionality implemented in Python works without problems, it
somehow seems to be linked with the way Perl passes OLE data to GME.

The following piece of Perl code should create a territory but does not
return a valid OLE Object which could be used e.g. in the BeginTransaction
(territory count always remains 0):

use Win32::OLE qw(in valof with);
use Win32::OLE::Variant qw(:DEFAULT nothing);
Win32::OLE->Option(Variant => 1);

my $gme = Win32::OLE->new('Mga.MgaProject'); # create project
$gme->Open( "MGA=C:\\Temp\\perltest\\configparadigm.mga" ); # opening
existing paradigm

print "creating Mga territory ...\n";
my $terr = $gme->CreateTerritory( nothing, nothing, nothing );
# corresponding python code from example (works): 
# terr = gme.CreateTerritory( None, None, None)

my $territory_count = $gme->Territories->Count;
print "  territory Count = $territory_count\n";

Does anybody have succeeded in using Perl with GME and could possibly
provide a working example?


More information about the gme-users mailing list