Solved

How to Show Error Message pop-up window in Perl?

Posted on 2006-11-01
4
579 Views
Last Modified: 2012-06-27
Hi..

I am working on ne script....that will create a .csv file as a output and copy that file to a network drive.
If the drive is not there...it mount that drive and copy that file...

I want to put something in there....that will pop-up the error message if the files are not copied due to some reason and then continue with the program.
As this script is called by another program, if I use die command it will stop there...instead I want to show error-message pop-up windiw....so user know that files are not copied...

Please advise....
0
Comment
Question by:nick2307
  • 2
4 Comments
 
LVL 17

Expert Comment

by:mjcoyne
Comment Utility
What OS will the script be running on?
0
 
LVL 39

Expert Comment

by:Adam314
Comment Utility
#!/usr/bin/perl
use strict;
use Tk;
use Tk::Dialog;


my $mw = MainWindow->new();   #Create object
$mw->withdraw();              #Don't display main window

my $response = $mw->messageBox(
 -icon => 'question',
 -message => 'Hello World!',
 -title => 'My title',
 -type => 'AbortRetryIgnore',
);

print "response=$response\n";
0
 
LVL 39

Expert Comment

by:Adam314
Comment Utility
If you will only be on Win32, there is a win32 only module.  The above will work on windows or unix.
0
 
LVL 18

Accepted Solution

by:
Morcalavin earned 125 total points
Comment Utility
For win32 only:

use Win32;

Win32::MsgBox("Message", 0 + MB_ICONINFORMATION, "Title");

http://search.cpan.org/~nwclark/perl-5.8.8/win32/ext/Win32/Win32.pm
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now