473,407 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Input Dialog...?

parajaganesh
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....?
Oct 29 '07 #1
8 2590
Here is the sample code...

Expand|Select|Wrap|Line Numbers
  1. #!/usr/local/bin/perl
  2. use Tk;
  3. use warnings;
  4. use strict;
  5.  
  6. my $mw = new MainWindow;
  7. my $ent = $mw->Entry()->pack();
  8. my $button = $mw->Button(-text => "OK",-command =>\&push_button);
  9. $button->pack();
  10. MainLoop;
  11. sub push_button {
  12.     $name = $ent->get();
  13.     $mw->messageBox(-type=>"yesnocancel",-message=>"$name");
  14. }
Oct 29 '07 #2
while running the code i got the following error...

Can't locate object method "new" via package "Tk::Configure" at C:/Rational/Common/lib/perl5/site_perl/5.8.6/MSWin32-x86-multi-thread/Tk/Derived.pm line 122. at dialog.pl line 7
Oct 29 '07 #3
KevinADC
4,059 Expert 2GB
The code seemed to work for me after fixing one error. Need to add "my" before $name in this line:

my $name = $ent->get();
Oct 29 '07 #4
I have put the my already...
Oct 29 '07 #5
KevinADC
4,059 Expert 2GB
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.
Oct 29 '07 #6
numberwhun
3,509 Expert Mod 2GB
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.
You may want to try re-installing the Tk::Configure module and see if that works.

Regards,

Jeff
Oct 29 '07 #7
May i know how to reinstall TK:Configure...?
Oct 29 '07 #8
jcor
63
One way to install a module is to get it from CPAN (Comprehensive Perl Archive Network) with the command:

perl -MCPAN -e "install TK::Configure"

good luck
Oct 29 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Dave Smithz | last post by:
OK, not strictly a PHP problem I guess but it occurred in my PHP project and I could not find a suitable Javascript NG (under pressure, already extended deadline. I user a "file" input type on a...
7
by: Basil Fawlty | last post by:
I need help and suggestions on how to modify the below program to get two numbers from user input using a input dialog box. B/c I'm a total newbie with next to no programming experience, I'm not...
2
by: Jim Witte | last post by:
Hi, How do I set a file input element? If it's a text input, I can set the value property. But this doesn't work with file inputs. And no, I can't change it - I'm writing a script to...
3
by: Federico | last post by:
Hello, I can't find how to do this: I have an input of type=file and I want that when the user clicks on it, javascript checks if some checkbox is selected and if so, the file dialog is shown....
0
by: tkailler | last post by:
Hello, I've created a dialog by creating a class in which Instead of calling wx.Dialog.__init__ I precreate the dialog and then I create the GUI dialog using the Create method. When I create...
3
by: june | last post by:
Hi, I am coding for an application with dialog window. I need intercept mouse input. I need catch raw input, pretty much everything for WM_INPUT: such as Left/Middle/Right button down/up,...
3
by: oopaevah | last post by:
I want to have a separate button which invokes the "browse" button on an input type=file. In internet explorer the following code works ok, in firefox nothing happens. All I do is call click()...
3
by: Ant | last post by:
Hi, I'm using a modal dialog box to input data. I have created properties on the dialog form to capture the data so that it might be read from the main form via the dialog form. This approach...
4
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
I've got an application that takes input from a handheld scanner: Once the incoming text meets the RegEx format and is the correct length, the command is accepted. The scanner that plugs in on...
5
by: snehadulur | last post by:
In the input box if we click ok or cancel the invoice prints. By default the credit card info is 0, and most of the cases its 0 even when we want to take a print out i.e., the value is changed. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.