Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: How do I obtain a list of values for all the properties of a Word document using Win32::OLE?

by ikegami (Patriarch)
on Jun 11, 2009 at 19:14 UTC ( [id://770742]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How do I obtain a list of values for all the properties of a Word document using Win32::OLE?
in thread How do I obtain a list of values for all the properties of a Word document using Win32::OLE?

Win32::OLE objects aren't copies of the foreign objects. If they were copies, you couldn't affect the remote objects. Each Win32::OLE object is an interface to a remote objects.

Any fetch from the referenced hash results in a get from the remote object.

Any change to the referenced hash results in a set in the remote object.

And yes, you are doing repeated fetches.

I suspect I'm not understanding how Data::Dumper works.

It works much like your code, except it doesn't print anything. The output is placed in a string, which is returned when it's done.

  • Comment on Re^3: How do I obtain a list of values for all the properties of a Word document using Win32::OLE?

Replies are listed 'Best First'.
Re^4: How do I obtain a list of values for all the properties of a Word document using Win32::OLE?
by romandas (Pilgrim) on Jun 11, 2009 at 19:28 UTC
    Okay. I can see that now. But.. I'm still at a loss for how to avoid the infinite loop while enumerating all the properties. Any advice?

      Trying to avoid looping entirely might not be possible. I don't see anything in Win32::OLE that would help uniquely identify an object, and that would be required to avoid looping.

      You could put limits on your looping (depth, time, number of objects visited, etc). Doing a breadth-first traversal (rather than a depth-first traversal) will make it easier to produce good results while adding limits.

      sub depth_first { my ($n) = @_; for ($n->children()) { depth_first($_); } } sub breadth_first { my @todo = @_; while (@todo) { my $n = shift(@todo); push @todo, $n->children(); } }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://770742]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-20 01:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found