in reply to Win32::OLE Word Search and Replace Script Runs Locally but not as part of CGI

The problem is that $doc is not defined, ergo and therfore your file open has failed as this is where it gets defined. If you check LastError it will tell you why it is failing (permissions or path) but you don't. If you do check you will no doubt be able to answer your own question. Do:

my $doc = $word->Documents->Open($oldfile) or die_nice( "Failed to ope +n $oldfie " . $word->LastError() ); ... sub die_nice { print "Content-type: text/html\n\n" . shift }

I don't see why you want to quote "$oldfile" so I have not. I doubt that this is the problem but your are interfacing with Win32 with a virus like language (to quote M$)

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

  • Comment on Re: Win32::OLE Word Search and Replace Script Runs Locally but not as part of CGI
  • Download Code

Replies are listed 'Best First'.
Re: Re: Win32::OLE Word Search and Replace Script Runs Locally but not as part of CGI
by logan (Curate) on Feb 14, 2003 at 18:35 UTC
    Perl is a virus-like language? Can you provide a link to back up that quote? I don't doubt for a minute that some MS PR weasel said it. I used to work for the Borg, and that's the attitude over there: if we can't control it, we have to destroy it. Still, I'd like to see a link to back up your statement.

    -Logan
    "What do I want? I'm an American. I want more."