Recently a perl program I wrote and that I and many others have been using for man years started failing on my Windows XP Pro PC (running Activestate perl 5.8.1). Here's s simple test setup:

Script1 calls script2 which calls script3

Script1

open(S2,"script2 |"); while (<S2>) {print;} close S2;

Script2

print "Script2\n"; system("script3");

Script3

print "Script3\n";

Previously when I ran script1 I got 2 lines of output:

script2 script3

When it fails I only get one output line

script2

I did modify script3 to write a file just to prove it was actually getting executed.

However, recently (after 1/18/2012), after a number of hours of poking around on 2 different PCs I finally determined that as long as I have ".plx" in the PATHEXT variable I only get the one output line, "script2". If I take ".plx"out of PATHEXT I get both lines of output. I've had ".plx" in PATHEXT for many years.

Does anyone have any idea what could be causing this strange behavior? For reasons I wont' go into here I'd like to be able to keep ".plx" in PATHEXT. I have added a line in the "real" script1 to remove ".plx" from PATHEXT at the beginning of the script and that makes it work. However, that is not a good solution for other scripts. Also, I'm concerned that other strange behaviors might occur that aren't as apparent.


In reply to Strange behavior with .plx in PATHEXT by ccw

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.