CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Win32 Programming Help:
quotes in exec paths

 



BillKSmith
Veteran

Apr 18, 2010, 8:13 PM

Post #1 of 1 (4807 views)
quotes in exec paths Can't Post

I am using ActiveState 5.8.8 under XP Home.
I want to display a web page by running
Microsoft Internet Explorer with the perl exec
command. The names of two of the folders in the
browser path contain space characters. The windows
command prompt program (shell) requires quotes
around the path to resolve the ambiquity that these
spaces cause. The following command
executes correctly from the command prompt:

"C:\Program Files\Internet Explorer\iexplore.exe" ask.com

My question is, how can I submit this command from perl.

The exec command in the following program
throws an exception (Invalid Argument).
The accompaning error message shows that the command was
formed exactly as shown above.

use strict;
use warnings;
my $BROWSER
= q("c:\\)
. q(Program Files\\)
. q(Internet Explorer\\)
. q(iexplore.exe")
;
my $web_page = q(ask.com);

exec $BROWSER, $web_page ;

__END__



I am aware that I can work around the problem
by using the short aliases for the folder names:

use strict;
use warnings;
my $BROWSER
= q(c:\\)
. q(progra~1\\) # Program Files
. q(intern~1\\) # Internet Explorer
. q(iexplore.exe)
;
my $web_page = q(ask.com);

exec $BROWSER, $web_page ;

__END__
Good Luck,
Bill

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives