in reply to Re^2: System path
in thread System path

As the error message suggests, it's attempting to execute a command named "files", so you could try a backslash (presuming the exe is in a subdirectory "files" — otherwise, what's the files/ supposed to be doing?)

system ("files\\pdftotext.exe -nopgbrk -q \"$file\"" ); ^

Not all components of Windows handle forward slashes and backslashes equivalently...

Replies are listed 'Best First'.
Re^4: System path
by welle (Beadle) on Apr 30, 2011 at 13:12 UTC

    I think the error is put out when exe doesn't a right path for the PDF file...

Re^4: System path
by welle (Beadle) on Apr 30, 2011 at 13:10 UTC

    "files" is just the directory containing the .exe file. Just to give you an idea. The following works fine

    sub convert{ system ("files/pdftotext.exe -nopgbrk - q example.pdf" ); }

    It converts example.pdf in example.txt. Crazy enough I am loosing so much time for this stupid thing...

      I'm no Windows person, but I know that Perl's internal processing of system arguments is rather complex... so maybe the difference of this example here (which works) to the other case with the quoted argument has the effect that the latter is executed via cmd.exe, while the former executes files/pdftotext.exe directly (in which case the forward slash wouldn't be a problem).  Just a guess, though, as at the moment I don't have a Windows to try.

Re^4: System path
by Anonymous Monk on Apr 30, 2011 at 12:57 UTC
    I agree with you in principle
    $ MSWin32-x86-multi-thread\perl.exe -V:sh sh='cmd /x /c'; $ MSWin32-x86-multi-thread/perl.exe -V:sh 'MSWin32-x86-multi-thread' is not recognized as an internal or externa +l command, operable program or batch file. $ "MSWin32-x86-multi-thread/perl.exe" -V:sh sh='cmd /x /c'; $ perl -e " system qq[MSWin32-x86-multi-thread/perl.exe -V:sh ] " sh='cmd /x /c'; $ perl -e " system q[MSWin32-x86-multi-thread\perl.exe -V:sh ] " sh='cmd /x /c';