in reply to need a popup gui stdin

For creating GUI application first refer : Perl/Tk or cpan perl tk A sample code :
Use Tk; my $mw = new MainWindow(-background=>'#3B5998'); my $frm_name = $mw -> Frame(); my $lab = $frm_name -> Label(-text=>"Enter your feedback"); my $ent = $frm_name -> Entry(); my $but = $mw -> Button(-text=>"Submit", -command =>\&push_button); $lab -> grid(-row=>2,-column=>1); $ent -> grid(-row=>2,-column=>2); $frm -> grid(-row=>2,-column=>1,-columnspan=>2); $but -> grid(-row=>4,-column=>1,-columnspan=>2); MainLoop; sub push_button { my $txt=$ent -> get(); $mw -> messageBox(-type=>"ok", -message=>"You printed this $txt"); }
Updated my code, it is just a sample program and also don't forget to install TK and dependencies related with it.

Replies are listed 'Best First'.
Re^2: need a popup gui stdin
by AnomalousMonk (Archbishop) on May 25, 2012 at 22:47 UTC
    Updated my code, it is just a sample program...

    The updated code still won't work. The statement
        Use Tk;
    is still wrong and the  $frm scalar is nowhere defined or, more importantly, initialized. See the statement
        $frm -> grid(-row=>2,-column=>1,-columnspan=>2);

    Even sample programs should actually work, especially when they are being given to beginners.

    Also, can you make the program run with strictures and warnings enabled?
        use warnings;
        use strict;