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

Inspired by Yet another question about GUIs for Perl, I'd be interested in monks' thoughts on XUL as a front end.

XUL is very much the flavour of the month in terms of interfaces. Anyone who's already got Mozilla or FireFox browsers has got the capability to run it already, plus there's an XUL Runner standalone. Installing procedures are established and the GIU looks entirely "native" as far as I can see.

But of course, because I'm asking here, you know I want to add Perl to the picture. There's no reason why an XUL application can't talk to a local executable file, Perl-based or anything else. But I can't understand the documentation here or here which talks about running local exectuables and communicating via sockets.

I can get the run command to my perl script and it seems to execute OK, but I don't see how to get any information back. For instance if I use the first example I can do process.run(false, args, args.length); and run my process successfully. But if my perl script prints "hello world" to STDOUT, I can't see how to do something like var perlOutput = process.run(false, args, args.length); and get it back into the XUL application for display or other coding.

Any ideas? Is the socket thing what I should be going for, or am I barking up the wrong tree? Should I ask elsewhere? My reasons for wanting to use Perl (apart from the obvious) is that I want to be able to read and write local files, which is still a pretty messy proposition as I understand it with XUL and JavaScript. Perhaps I'm wrong about that too?



($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
=~y~b-v~a-z~s; print

Replies are listed 'Best First'.
Re: OT-ish: using XUL as a front end to Perl
by kvale (Monsignor) on Apr 17, 2006 at 01:13 UTC
    You might look at XUL::Node for a module interface to the XUL server.

    -Mark

      Any idea why that module hasn't been updated since aug 2004? Seems odd with Firefox being such a fast-moving project.
        I'd guess that's because XUL had to stay API compatible between major releases. I understand there will be many changes to the XUL and XBL APIs in Firefox 2. You might check the trunk sources to be sure.

        XUL::Node seems fairly complete at first glance... can't hurt to try it out.
      Ah, but I was hoping to to have to use a server at all. I was hoping for an application or script which could run locally without a server.


      ($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
      =~y~b-v~a-z~s; print
        The server can be local. In fact you can use NSIProcess to start it up.