Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2006-11-01
4
Medium Priority
?
604 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 17

Expert Comment

by:mjcoyne
ID: 17850578
What OS will the script be running on?
0
 
LVL 39

Expert Comment

by:Adam314
ID: 17850650
#!/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
ID: 17850663
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 500 total points
ID: 17850944
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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…
Six Sigma Control Plans

721 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