One supposes this means that using system in a Perl script to call up a document will not launch the associated application.

No, it will. The behavior I observe is that it will first try to start the file as a program (CreateProcess), and if that fails to work, then try again with file associations (ShellExecute). You only see this when you have a exe file renamed to something like html. Perl will execute the program like an exe file, but clicking on it will start your web browser and display the binary data. However, if you have a html file with html actually in it, Perl will start the web browser on it too. This might create a security hole if a program is running system($filename) on untrusted files. So don't do that.

Out of curiousity, what if you rename an EXE with a .bat extension and double-click it?

.bat files are actually text files which are input to cmd.exe. So if you do this, you will start up a cmd.exe and try to feed the binary data into it, which will not work very well.


In reply to Re^2: Perl Directive by bunnyman
in thread Perl Directive by Echo Kilo

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.