Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Reading output of external program without Shell

by haukex (Archbishop)
on Nov 15, 2017 at 10:39 UTC ( [id://1203456]=note: print w/replies, xml ) Need Help??


in reply to Reading output of external program without Shell

One thing I see in your code is that you're not checking the return value of close. I wrote about the topic of running external commands at length here. From the several possibilities listed there, in this case I might suggest you try IPC::Run3 first, because it seems to work well on Windows. One thing to keep in mind is whether pdftotxt.exe is always going to be in your PATH environment variable, and if not, you should use absolute pathnames (using a suitable module for handling those, like File::Spec or Path::Class). Also, I am guessing that this program may have the ability to write its output to a file, in which case you might just want to have it do that, using File::Temp to generate suitable temp files, and then reading the file back in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1203456]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2024-04-18 08:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found