Sorry, the code inside of perl.exe that gets run is convoluted (it converts the arguments to exec into a string which it then converts into a list of command words, which are then converted back into a string, *sigh*) and rather buggy. It has also changed between versions of Perl so exactly what works depends on what version of Perl you have.

You could use Win32::Process which gives you much more direct access to what exec ends up calling anyway.

But, you can also just avoid quotes around the executable name which appears to be what triggers several of the bugs. Luckily, these are easy to avoid by using Win32::GetShortPathName():

use strict; use Win32; my $date = sprintf("%04d%02d%0d", (localtime)[5]+1900, (localtime)[4]+1, (localtime)[3] ); my $url = "www.moviefone.com/showtimes/closesttheaters.adp?date=$date\ +&skip=5"; my $command = Win32::GetShortPathName( "C:/Program Files/Internet Explorer/IEXPLORE.EXE" ); $command = qq($command "$url"); print "$command"; ''.<STDIN>; exec( $command );
which I tested. (:

        - tye ('Tye' is not recognized as an internal or external command)

In reply to (tye)Re2: windows command line problem? by tye
in thread windows command line problem? by xafwodahs

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.