Since no one has given an answer yet, I'll chime in with confirmation. I see the same thing on Windows 10, even when not using Tk. I ended up spawning $^X, $pathToMyself because my perl association isn't working (new computer, apparently hadn't used my assoc yet), but I get the same results -- I have to hit ENTER to actual enter the new instance.
#!/usr/bin/env perl
use warnings;
use strict;
my $pathToMyself = $0;
local $, = "\n\t* ";
local $\ = $/;
print "\t".$^X, $0, @ARGV;
restartMe() unless @ARGV;
sub restartMe {
print "Restarting $pathToMyself...\n";
#exec( $^X, $pathToMyself ) or die "couldn't exec $pathToMyself: $
+!";
#system(1, $^X, $pathToMyself, "don't Restart", "final" ); exit;
#system(1, "cmd.exe", "/c", $^X, $pathToMyself, "final"); exit;
exec("cmd.exe", "/c", $^X, $pathToMyself, "final") or die "couldn
+'t exec $pathToMyself: $!";
}
As you can see from my commented lines, I tried various combinations of exec and system, both with and without an explicit cmd.exe interpreter. I don't know what's going on, but I can definitely confirm it.
edit: fixed my association to be perl "%1" %*, so it would run without the cmd or $^X, but no change in behavior
system(1, $pathToMyself, "don't Restart", "final" ); exit;
#exec( $pathToMyself, "final" ) or die "couldn't exec $pathToMyse
+lf: $!"; # can't exec ___: Exec format error -- because this runs wit
+hout the cmd.exe overhead, so it doesn't try the association for .pl
+file
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.