Hello all.  I have the following snipped of code in .vbs that runs fine:

'  Begin vbs
Dim theFarm, aLicense
Set theFarm = CreateObject("MetaFrameCOM.MetaFrameFarm", "myserver")
' Initialize the farm object.

theFarm.Initialize(1)

For Each aLicense In theFarm.LicenseSets(1)
        If aLicense.LicenseID = "0000000000000003" Then
                wscript.echo date & "," & time & "," & aLicense.Name & 
"," & aLicense.pooledinuse("")
    End if
Next
'  End vbs

I translated the code to Perl as follows:
#  Begin Perl
use Win32::OLE;
use Win32::OLE::Variant;
use Win32::OLE::Const('Citrix MetaFrame COM Library');

$objFarm = new Win32::OLE("MetaFrameCOM.MetaFrameFarm", "myserver");

if (Win32::OLE->LastError() != 0) {
    print "Couldn't create a farm object \n";
    print Win32::OLE->LastError();
    exit 0;
}

$objFarm->Initialize(1);
if (Win32::OLE->LastError() != 0) {
    print "Couldn't initialize a farm object \n";
    print Win32::OLE->LastError();
    exit 0;
}
print STDOUT "Farm name is ".$objFarm->FarmName."\n";

foreach my $aLicense (in $licSets) {
        print STDOUT "#\n";
        if ($aLicense->LicenseID = "0000000000000003") {
                print STDOUT "Found it!\n";
        }
#  End Perl

The Perl code works ok upto the point of successfully printing the "Farm 
name".  However, the collection returned in licSets in Perl always 
appears to be empty, whereas it works fine in VB.  Can anyone shed some 
light on this?

Thanks in advance for any help,

-- 
--Moby


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to