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
In reply to Re: Restarting a Perl script on Windows 10
by pryrt
in thread Restarting a Perl script on Windows 10
by petro4213
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |