[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] MacPerl cmd line?



At 16:55 -0500 98/07/15, Gabriel Cheifetz wrote:
> Howdy,
>
> I need to build (oddly enough) a command-line interface for a large
>MacPerl
> application I'm working on.
>
> Does anyone have GUI code for this lying around? I just need the
> windowing/scrollbar pieces.

You could just let MacPerl do it all for you; run your code in a loop, let
the "output" window be the "input" window.  In the simplest form, just put
a loop around a read from STDIN, as:

  #!perl
  while (1) {
      print "prompt> ";
      $input = <STDIN>;
      chomp $input;
      # deal with what you got and loop
  }

If you need more, Rich Morin & I have been woking on a fairly large and
complex piece of code that sorta kinda emulates a Unix shell :-)  It wasn't
done in time for the book, but I'd be happy to send it along as a fairly
complex example!

- Vicki
---
Vicki Brown, vlb@cfcl.com        |\      _,,,---,,_
Journeyman Sourceror      ZZZzz /,`.-'`'    -.  ;-;;,_
Scripts & Philtres             |,4-  ) )-,_. ,\ (  `'-'
http://www.cfcl.com/~vlb      '---''(_/--'  `-'\_)
P.O. Box 1269 San Bruno, CA  94066

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch