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

Hi all,

I am using win32::msgbox in my application. part of the script which displays Message box is as follows
use Win32; $txt = "Test"; $button = 0; $head = "test"; Win32::MsgBox($txt, $button, $head);
this works fine if I invoke it through command prompt. But it doesn't display anything if I invoke it through ASP. The ASP Code is as follows.
<html> <body> <form action = "disp.asp" method = post> Enter a Value <input type = "text" name = "fname" size = 0> <input type = "submit" value = "click"> </from> <% dim nm nm = request.form("fname") if nm <> "" then set shell = Createobject("wscript.shell") shell.run "cmd.exe /c C:\\Perl\\bin\\perl " & nm, 1, 1 set shell = nothing end if %> </body> </html>
Can anyone plz tell me how can I display messagebox in perl which should work even when I call it from ASP.

Thanks in Advance

20050328 Edit by castaway: Changed title from 'Perl + msgbox'

Replies are listed 'Best First'.
Re: Using Win32::MsgBox via ASP
by Joost (Canon) on Mar 22, 2005 at 13:24 UTC
Re: Using Win32::MsgBox via ASP
by gellyfish (Monsignor) on Mar 22, 2005 at 13:31 UTC

    Again I am wondering why are trying to do something by shelling out to a Perl program from an ASP when you could simply do:

    if nm <> "" then MsgBox("Test",0,"test") end if
    In your ASP. Anyway where are you expecting the Perl generated Message Box to display? - you are running the perl program in the server context which effectively does not have a GUI, the message box will not be displayed for the client.

    /J\

Re: Using Win32::MsgBox via ASP
by Errto (Vicar) on Mar 23, 2005 at 03:41 UTC
    As an alternative, you could write your ASP code in Perl. I haven't done this but I believe it looks roughly like:
    <%@Language=PerlScript%> <% ...Perl Code here... $Response->Write("foo"); %>
    This saves you from dealing with the shell calls. But again, it won't help much with displaying a message box to the user.