jwills has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to create a script that will allow me to query the Citrix Farm (using the WIN32 MetaFrameCOM.MetaFrameFarm ).

I can create and initialize the object without error by the following code (error checking has been eliminated in this example) :
my($oPolicy) = new Win32::OLE("MetaFrameCOM.MetaFrameFarm"); $oPolicy->Initialize(MetaFrameWinFarmObject);

When I try to access the sessions it seems to return a hash (which is more or less expected). However each element in the hash seems also to be a hash (with the same address) - so I am missing something.

I've not found any decent documentation or examples of anybody doing this.

Does anybody here have a good example - or can offer advice?

Sincerely

Replies are listed 'Best First'.
Re: Help - Citrix Metaframe
by vladdrak (Monk) on Sep 01, 2004 at 09:10 UTC
    I would bet you're really not getting a useful hashref, but rather an OLE object; you can iterate through the hashref (keys %$hasref) to confirm this. I would check the documentation, you'll likely have to call another method to access the actual data returned, something like $oPolicy->GetValue(), or even $oPolicy->Something->GetValue().
Re: Help - Citrix Metaframe
by chb (Deacon) on Sep 01, 2004 at 07:39 UTC
    Try to feed the hash to Data::Dumper. Those addresses you see with a plain print are usually not very informative...
Re: Help - Citrix Metaframe
by EverLast (Scribe) on Sep 02, 2004 at 07:00 UTC
    There's a lot of generic Win32::OLE info in Using Win32::OLE and Excel - Tips and Tricks, and it has links to some good books on the subject (I have the Roth Book myself).

    As for exploring the MetaFrame object model, do try out the "Type Library Browser" installed with ActiveState Perl (in ../html/OLE-Browser/Browser.html, its installed as a HTML link in the perl program group).

    ---Lars