Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (1)
As of 2024-04-19 00:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found