Michael wrote:
> my application reads several paths from a configruation file.
> Some of these paths pointing to an executable which are to start
> with an input file. Example: Adobe Reader with a pdf-file.
>
> The executables are stored in c:\Program Files\...
>
> When I try to execute the following, Perl is obvioulsy not able
> to handle the spaces within the path information correctly and
> aborts with
> 'c:/Programm' is not recognized as an internal or external command,
> operable program or batch file
It's not Perl that can't handle it. It's your shell. Try typing that
path exactly on the command line, see what happens.
> Does anyone know a solution or could help me?
This question has come up about three different times in the last
month. Please search the archives.
Short answer: Quote your path, escape the spaces, or use the multi-arg
form of exec/system to avoid the shell altogether.
system(q{ "C:\Program Files\Adobe\Reader.exe" file.pdf } );
or
system(q{C:\Program\ Files\Adobe\Reader.exe file.pdf});
or
system(q{C:\Program Files\Adobe\Reader.exe}, q{file.pdf});
Paul Lalli
|