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

I have following code.

$wfs = $system->GetActiveWorkflows();

$wfs is a reference to an array containing references to TeamSite::WFworkflow objects.

Now, I want to get all the elements (each workflow) from this array. How can I get it ? It looks that this $wfs will give the number of elements. Do I need to use @wfs = $system->GetActiveWorkflows() ?

Thanks

  • Comment on How to get array elements from reference ?

Replies are listed 'Best First'.
Re: How to get array elements from reference ?
by Corion (Patriarch) on Jun 07, 2011 at 15:09 UTC
    $wfs is a reference to an array

    I doubt that. What does the TeamSite documentation say?

    Most likely, ->GetActiveWorkflows() returns an OLE collection, which would mean you have to work with $wfs->Count and $wfs->Item() or the in function of Win32::OLE.

    If $wfs really contains a number after your assignment, then what you proposed should work. What happened when you tried it?

      ARRAY(0x1a7cb04)

      I am getting this output, when I run this script