The perl script runs fine from the command line but when I execute the same perl script using the coldfusion cfexecute it fails to run.
It cannot find the methods/functions used in the perl script like SelectAllEditableRanges, Bookmarks, InsertAfter. The script fails whereever this functions are called in the perl script.
How do I run the perl script using cfexecute.
Show us what you're using for the cfexecute attributes, and the command you use at the command line.
Also, I'm not sure it's wise to just drop a reply into a 12 year old thread like this. It's possible the previous participants either are no longer involved, not able to help, or may even not want to hear from us (if they're setup to receive amail notifications of replies in this thread).
I have a perl script which runs fine from the command prompt but fails to run the coldfusion using cfexecute
<CFEXECUTE NAME="c:\perl64\perl.exe" ARGUMENTS="c:\temp\test.pl #filename# #empno#" TIMEOUT="100"> </CFEXECUTE>
In the test.pl I open the #filename# word document and find the bookmark employee number and update the bookmark with the #empno# value.
The script runs with out any errors from command prompt. But, when I run from coldfusion the word running in the background and the only way to fix the stalling is to terminate the process.
I have tested the hello.pl using the cfexecute and it works fine from the coldfusion.
What's the value of #filename#? If it's a relative vs absolute path, that may be your problem.
If that's not it, simplify things to find what perhaps DOES work if you make changes, such as calling a simpler pl file, or something other than perl, etc.
The #filename# is c:\temp\test.doc. cfexecute opens the word document fine.
In the perl script I call other methods like bookmark and cfexecute fails to find the methods in the word.
Any idea if I need to use the cf_exec tag?
I'm out of ideas for now. Have only been answering off the top of my head not testing things. Maybe someone else (or I, later) may see the solution for you. There must be one, or a clear explanation why what you want to do doesn't work.
But as that other option was indeed offered in the other thread you opened on the cf portal, it's worth a shot if you're pressed for time.
I did a quick search for SelectAllEditableRanges, and it seems your perl script is possibly using Microsoft Office Automation to process the document. It's probably trying to execute MS Word and that's where it could be failing. This article may be of use to you: