I would establish that it is in fact Win32::OLE that is locking up your laptop and one way to do that is write your script without it. :-)
Put your script to one side for a moment and write a short script that demonstrates that you can find the files you want to work with. You refer to a sample_folder at the top of the script (with a path relative to your script - where is your script?) and in the loop you look in parent_folder (with a full path - a better way to go). Is that correct? If it is you would need more error checking.
Perhaps something like the following would help you see what the script is actually doing (adding print statements) and then adjust if necessary.
When you're sure you can see the files you need then perhaps another short script using Win32::OLE to open one of the files and get at the table cells.#!/usr/bin/perl use strict; use warnings; my $directory = q{C:/Users/john/Documents/sample_folder}; opendir my $dh, $directory or die qq{cant open *$directory*}; my @dir_list = grep {/^EN-US_.+/ && -d qq{$directory/$_} } readdir $dh +; # does this print what you expect? print qq{dir_list: $directory\n}; print qq{$_\n} for @dir_list; print qq{*****\n}; for my $dir (@dir_list){ my $doc = sprintf(q{%s/%s/sample_doc.doc}, $directory, $dir); # are these the right files? print qq{$doc\n}; if (-f $doc){ print qq{found\n}; } else{ print qq{not found\n}; } }
Get both working nicely and then put them together.
In reply to Re: WIN32::OLE MS WORD TABLE CELL READING PERL
by wfsp
in thread WIN32::OLE MS WORD TABLE CELL READING PERL
by pooTan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |