zakzebrowski has asked for the wisdom of the Perl Monks concerning the following question:

Hi all. From perl, is there a way to do an alert box? I really don't care about the return value. (I am going to have a huge, multi-part script and I want to prompt the user what to do next, or if one of the preconditions failed.) Thanks. Zak

Replies are listed 'Best First'.
Re: Win32 Alert Boxes from Perl
by $code or die (Deacon) on Jan 19, 2001 at 16:49 UTC
    I wouldn't use either Win32::GUI or Tk - they are great, but an awful lot of work if you just want an alert box! Just do this:
    use Win32; $returnvalue = Win32::MsgBox("Hello World",4,"WindowTitle"); print $returnvalue;
    Simple! That prints a message box with Yes and No buttons, the text "hello world" and then prints "6" if the user clicked yes, and 7 if the user clicked no, in your perl window.

    Just check perldoc Win32 and scroll down to MsgBox

    $code or die
    Using perl at
    The Spiders Web
      Thanks dude, this was exactly what I was looking for. I knew of the TKL and I new that Win32 had the api interface, but I didn't know that the Win32 package itself had support for MsgBox's. :) Thanks!
Re: Win32 Alert Boxes from Perl
by jepri (Parson) on Jan 19, 2001 at 09:24 UTC
    Yes, download and install Tk from CPAN. The Win32 module may also do that.

    ____________________
    Jeremy
    I didn't believe in evil until I dated it.

      Unless you're planning on doing a lot more than just a popup alert, Tk seems to me to be an awful lot of trouble. Win32::GUI strikes me as a better fit, since you don't need it to be cross-platform.