From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28823 invoked from network); 18 Apr 1998 04:39:40 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 18 Apr 1998 04:39:40 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id AAA07120; Sat, 18 Apr 1998 00:24:44 -0400 (EDT) Resent-Date: Sat, 18 Apr 1998 00:24:32 -0400 (EDT) From: "Bart Schaefer" Message-Id: <980417142417.ZM709@candle.brasslantern.com> Date: Fri, 17 Apr 1998 14:24:17 -0700 In-Reply-To: <199804180044.TAA19945@psasolar.psa.pencom.com> Comments: In reply to tep@colltech.com "Perl and ZSH (WAS: Re: backing up with zsh)" (Apr 17, 7:44pm) References: <199804180044.TAA19945@psasolar.psa.pencom.com> X-Mailer: Z-Mail (4.0b.820 20aug96) To: zsh-users@math.gatech.edu Subject: Re: Perl and ZSH (WAS: Re: backing up with zsh) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"91N_t.0.ak1._h2Er"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1464 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Apr 17, 7:44pm, tep@colltech.com wrote: } Subject: Perl and ZSH (WAS: Re: backing up with zsh) } } I've actually been tinkering with the idea of embedding a Perl } interpreter inside ZSH I can't convince myself that this is a good idea. You'd have to change zexecve() in order to get perl programs to run in the internal interpreter (i.e., you couldn't let the kernel interpret #!/usr/bin/perl), which would be a performance hit on every binary exec. Also, there's a fundamental difference between shell scripts and perl programs that would make it very impractical to have the perl interpreter state hang around for the entire time the shell is running; but if you shut down the interpeter after every call, you haven't gained much by making part of the shell. That said, however: } but I got stumped when it came time to } think about sharing data (i.e. variables and such). Make it a loadable module using the new facilities in 3.1.x. Forget about sharing anyting other than environment variables, which will "just work"; it's easy enough to "export" variables from zsh and stuff things into the %ENV hash in perl, if values really need to be passed back and forth. (I suppose you might need to do a little tweaking, in case perl ignores the actual environ array after first setting up %ENV.) Make the interface to perl look like a builtin shell function, so that the existing zsh code handles argv and i/o redirection. } Anyone care to assist in this endeavor?? :-) Not more than I just did. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com