home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!wupost!psuvax1!flee
- From: flee@cs.psu.edu (Felix Lee)
- Subject: Re: Perl meets shell
- Message-ID: <Bs0yBv.3zw@cs.psu.edu>
- Sender: news@cs.psu.edu (Usenet)
- Nntp-Posting-Host: dictionopolis.cs.psu.edu
- References: <Brs2rD.Fz1@cs.psu.edu> <1992Jul24.160750.22163@news.eng.convex.com>
- Date: Mon, 27 Jul 1992 02:47:49 GMT
- Lines: 42
-
- Tom Christiansen writes of "exechook".
-
- It's a good idea, but I'm not sure I really like it.
-
- There's a minor maintenance problem, in keeping the links to exechook
- in sync with your Perl library.
-
- About repeated application to STDIN, Tom writes:
- > What I don't like about this is that it makes no allowance
- > for routines that get no arguments by their very nature.
-
- This is why I have two different front-ends, "perl-map" and
- "perl-apply".
- perl-apply substr "abcd" 0 1
- v.
- perl-map sqrt 1 2 3 4 5 6 7 8
- and
- cat data | perl-map sqrt
-
- perl-apply is straight subroutine call, but perl-map creates a filter,
- which is generally sensible for shell use.
-
- Right now, I think I use "perl-apply" and "perl-map" mostly for
- testing. It's convenient to create a temporary alias
- alias t 'perl-apply file:function'
- and run test cases by hand.
-
- The distinction between "perl-apply" and "perl-map" is one reason why
- I feel the front-end code should be embedded in the Perl modules.
- Each Perl module is better able to create a sensible shell usage for
- itself than any generic front-end can.
-
- Looking at it from the other end, I have standalone Perl programs that
- I want to embed in other Perl programs, with 'require'. This is the
- same problem, with the same solution.
-
- Niklaus Wirth's Oberon language, in the Oberon environment, doesn't
- have a distinction between "programs" and "functions". Running a
- program is simply calling a function in some module. Lisp systems
- also lack this distinction. The Unix environment is no help at all in
- this, and even deliberately makes things difficult.
- --
-