in reply to Restarting a Perl script on Windows 10
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Restarting a Perl script on Windows 10
by BillKSmith (Monsignor) on Sep 21, 2019 at 15:06 UTC | |
by pryrt (Abbot) on Sep 23, 2019 at 14:53 UTC | |
|
Re^2: Restarting a Perl script on Windows 10
by Anonymous Monk on Sep 22, 2019 at 18:59 UTC | |
by petro4213 (Acolyte) on Sep 23, 2019 at 08:12 UTC | |
by Anonymous Monk on Sep 24, 2019 at 08:21 UTC | |
by Anonymous Monk on Sep 24, 2019 at 08:31 UTC | |
by Anonymous Monk on Sep 24, 2019 at 22:15 UTC |