Hi Monks,
I hope this is not too esoteric, but I'm having a problem with system on my W2K machine after upgrading from ActiveState Perl 5.8.4 to 5.8.8. Things like the following initiate action, such as running vim against a specified file, but then control does not seem to return to my program, i.e. the Tk window from which I kicked off the system command has frozen and I have to kill the application.

$mw->iconify(); $found_problem = system $path_of_wp, $abs_pgm_log_file; $mw->deiconify();

In the Release Notes section of the 5.8.8 documentation there is a section called 'New warnings and deprecations'. Among other things it says that:

The exec LIST and system LIST operations now produce warnings on tainted data and in some future release they will produce fatal errors.

I'm not running the program in Taint mode and so I wouldn't expect this is relevant. But maybe it is.

Elsewhere in the docs, I find the following, though this should have been absorbed/okay on my previous platform of 5.8.4.

Build 808 Saturday, Dec 6, 2003
Build 808 is based on Perl 5.8.2.

<snip>

Build 805 Thursday, Feb 6, 2003
Bug Fixes and Changes

On Windows, system() and backticks could return invalid status when running under environments where the process has to handle Windows messages. PerlScript and Perl for ISAPI fall under this category. The problem has been corrected.

The following seems to illustrate the problem on my (now) 5.8.8 system; running it produces a widget with an 'Ok' button; press it, you edit a README file, but the controlling Tk app in the background does not experience a destroy. Switch to the dummy line instead of the system line and it seems to destroy just fine. Hmm.

Thanks.

use Tk; use strict; my $poss_answer = 'Ok'; my $answer = 'Ok'; my $mw = MainWindow->new; $mw->Radiobutton( -text => $poss_answer, -value => $poss_answer, -variable => \$answer, -padx => 10, -command => sub { warn "TkAns82: '$answer'\n"; my ( $path_of_wp, $abs_pgm_log_file ) = ( 'C:\vim\vim61\gvim.exe', 'C:\vim\vim61\README.txt', ); $mw->iconify(); my $found_problem = system $path_of_wp, $abs_pgm_log_file; #= 'dummy'; $mw->deiconify(); $mw->destroy(); }, )->pack( -side => 'bottom', ); $mw->withdraw; #avoid the jumping window bug $mw->Popup; MainLoop();

In reply to 'system' hangs in a Windows Tk app by ff

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.