in reply to Win32 spaces in path, open Excel w/ 'system' and glob/DosGlob

You might also try using File::Spec to help you out with the path information.

use strict; use warnings; use File::Spec; my $path=File::Spec->catfile('C:',"Program Files","Microsoft Office"," +Office","Excel.exe"); print "\$path gives you: $path\n"; __END__ Output: $path gives you: C:\Program Files\Microsoft Office\Office\Excel.exe.
Of course, the spaces in the path might still give you problems. You may need to use literal quotes around the path to prevent problems.


"Ex libris un peut de tout"

Replies are listed 'Best First'.
Re: Re: Win32 spaces in path, open Excel w/ 'system' and glob/DosGlob
by vek (Prior) on Oct 24, 2003 at 00:11 UTC

    Using File::Spec is always a good idea in my book. If you want your file path code to work on multiple platforms (and to be honest, why wouldn't you?) then using File::Spec takes all the pain away and leaves you free to worry about other things instead :-)

    -- vek --