I am a begineer for Perl. I need to get an input from the user. In general, we user <STDIN> for input. Is there any Input Dialog Box method is available in Perl....?
Input Dialog...?
Collapse
X
-
Tags: None
-
Here is the sample code...
[CODE=perl]
#!/usr/local/bin/perl
use Tk;
use warnings;
use strict;
my $mw = new MainWindow;
my $ent = $mw->Entry()->pack();
my $button = $mw->Button(-text => "OK",-command =>\&push_button );
$button->pack();
MainLoop;
sub push_button {
$name = $ent->get();
$mw->messageBox(-type=>"yesnocan cel",-message=>"$name ");
}[/CODE] -
while running the code i got the following error...
Can't locate object method "new" via package "Tk::Config ure" at C:/Rational/Common/lib/perl5/site_perl/5.8.6/MSWin32-x86-multi-thread/Tk/Derived.pm line 122. at dialog.pl line 7Comment
-
-
I thought maybe you did otherwise the code would not even compile. Are you trying just the code that was posted? If so, I don't know why it is not working. If you are trying different code you need to post the code you are trying to use.Comment
-
You may want to try re-installing the Tk::Configure module and see if that works.Originally posted by KevinADCI thought maybe you did otherwise the code would not even compile. Are you trying just the code that was posted? If so, I don't know why it is not working. If you are trying different code you need to post the code you are trying to use.
Regards,
JeffComment
-
Comment