in reply to WIn32::OLE debug

It helps a bit to know about VBA / OLE. The ->Item method is what is used to enumerate arrays. The in function is what maps that to Perl.

In your code, you have:

my $tables = $word->ActiveDocument->{Tables}; for my $table (in $tables) {

If the document has no tables, maybe $tables is undef. Check for that.

If your debugger crashes, do print debugging:

my $tables = $word->ActiveDocument->{Tables}; print "Tables is <$tables>"; print sprintf "Tables has %d items", $tables->Count; for my $table (in $tables) {