[gme-users] Interfacing GME with Perl

James Hill hillj at isis.vanderbilt.edu
Fri Nov 30 16:38:00 CST 2007


Hey Simon, 

> -----Original Message-----
> From: gme-users-bounces at list.isis.vanderbilt.edu 
> [mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf 
> Of Simon Görke
> Sent: Friday, November 30, 2007 8:34 AM
> To: gme-users
> Subject: [gme-users] Interfacing GME with Perl
> 
> Hi folks,
> 
> Does anybody have experience with interfacing GME and Perl using OLE?

I have very little. I would recommend not using Perl since there are some features COM (like optionals) that aren't either supported in PERL, or I haven't figured out. In the end, I just gave up on the Perl approach.

HTH,

- James

> 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 method (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?
> 
> Thanks,
> Simon
> 
> _______________________________________________
> gme-users mailing list
> gme-users at list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users
> 


More information about the gme-users mailing list