http://qs321.pair.com?node_id=85639

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

Hi, this is jsl, long time joiner first time caller. In java you are capable of "sensing" the mouse movements, i.e. if you place your mouse on an icon, it lights up. Can it be done with Perl and CGI scripts? Thanks a trillion

Replies are listed 'Best First'.
(jeffa) Re: java wanna be
by jeffa (Bishop) on Jun 05, 2001 at 02:30 UTC
    Short answer: no

    I think you mean JavaScript by the way - but Java does have events in Applet and Application programming. Take a look at Tk or Win32::GUI if you want to use Perl to create window-style applications.

    But as for Web applications, the only way to access events such as a mouseOver is through JavaScript. :(

    Jeff

    R-R-R--R-R-R--R-R-R--R-R-R--R-R-R--
    L-L--L-L--L-L--L-L--L-L--L-L--L-L--
    
Re: java wanna be
by cLive ;-) (Prior) on Jun 05, 2001 at 12:43 UTC
    Sorry, OT, but I do like this quote...

    "If Java had true garbage collection, most programs would delete themselves upon execution"

    - Robert Sewell

    .02

    cLive ;-)

Re: java wanna be
by sierrathedog04 (Hermit) on Jun 05, 2001 at 06:09 UTC
    No, because Perl CGI, unlike Java, does not have applets that run client side. In order for a CGI script (which by definition runs server-side) to sense the mouse's movements the mouse would have to continually submit its coordinates by posting them in a form, and that is not practical.
Re: java wanna be
by Beatnik (Parson) on Jun 05, 2001 at 09:51 UTC
    You can always bring Java into Perl :)

    Greetz
    Beatnik
    ... Quidquid perl dictum sit, altum viditur.
      Perl is not in itself a windowing client but it can drive libraries which display windows, as with Tk.

      In the web context, if you use Javascript to create images in Netscape which automatically highlight on mouseover, Perl can modify that file on the fly to specify which images should be drawn. You would modify a template containing the Javascript on the fly.

      If a gorgeous interface is the most important thing to you, Java or a DHTML interface with Javascript is the answer to the front end. Java or Perl can be used on the back end. Personally I find Swing too heavy and you can probably get everything you need for a web app through DHTML.