£okì has asked for the wisdom of the Perl Monks concerning the following question:

I've got a program I'm working on using Win32::GUI. All of my syntax is correct (it's included below if you would like to check) and I've got the latest releases of Activestate Perl and the Win32::GUI perl module. However, the command line interpeter is CRASHING whenever I try to compile. I've tried this on several computers now. I've traced the actual line that's causing it to crash to the one below:
$main->AddLabel(-text => $text);

Any suggestions, reasons this might be happening because I'm stumped.

use Win32::GUI; $text = "Testing!"; $main = Win32::GUI::Window->new( -name => 'Main', -text => 'INSCO Inventory Manager', -height => '600, -width => '800' ); $main->AddLabel(-text => $text); $main->Show(); Win32::GUI::Dialog(); sub Main_Terminate { -1; }

Replies are listed 'Best First'.
Re: Command Line Interpeter Errors
by BrowserUk (Patriarch) on Mar 18, 2003 at 15:18 UTC

    Giving the label a name prevents the problem for me.

    $main->AddLabel(-name => 'dummy', -text => $text);

    Examine what is said, not who speaks.
    1) When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
    2) The only way of discovering the limits of the possible is to venture a little way past them into the impossible
    3) Any sufficiently advanced technology is indistinguishable from magic.
    Arthur C. Clarke.
      Heh, thanks. That fixed the problem. Should note to the developers of Win32::GUI that is a problem I guess. That should have returned a syntax error not a crash of the interpeter.

        Well it couldn't be a syntax error, because syntactically, Perl doesn't know you should have a name for your label. It would have to be some kind of runtime error in the Win32::GUI module. But I do agree that it could have been caught without crashing the program.

        kelan


        Perl6 Grammar Student

Re: Command Line Interpeter Errors
by sschneid (Deacon) on Mar 18, 2003 at 15:01 UTC
    You are missing a closing apostrophe on the -height => '600, line.

    -s.
      eh, that was me cleaning up code for you guys to make it pretty. That would only cause a syntax error anyway. I'm trying to figure out how to deal with the line interpeter crashing.