|Just another Perl shrine|
Re: Win32::OLE not opening a window for meby ww (Chancellor)
|on Mar 23, 2012 at 13:27 UTC||Need Help??|
"the message, "Main::$doc only used once" which may be something."
Yes, it indeed is "something."
It is telling you that you have used the variable $doc only once (in scope) in your script.
Perhaps you've drawn an incorrect conclusion about visibility (which I infer from your title): $doc is visible to perl in (some part of) the script; if you want "eyeballs on" the contents of $doc,
( ... and, of course, that presumes that you've provided an accurate path and filename in $document_path. More detail on the script may be needed to ascertain that, if there's another problem.)
Update: ... 'oops!', says /me. I now think I misunderstood/misread part of your problem. The message you quote is, indeed, telling you what I said in the first two para after the quote, but John Davies' understanding of what you were talking about re "visible" seems likely to be far closer to be an answer to your visibility issue than that in the portion marked by strikethrus above.
Update 2: PS: if you're using strict (highly recommended because it can help find one's errors), then you should have received another message... something to the general effect that " ... $doc requires requires explicit package name at line nnn." The more we know about things like error messages and warnings, the better the help we provide (as long as we don't misread the problem :-( ).