From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23519 invoked from network); 26 Aug 1999 04:10:08 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 26 Aug 1999 04:10:08 -0000 Received: (qmail 7705 invoked by alias); 26 Aug 1999 04:10:02 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7487 Received: (qmail 7696 invoked from network); 26 Aug 1999 04:10:02 -0000 Sender: fletch@phydeaux.org To: zsh-workers@sunsite.auc.dk Subject: Zsh perl module From: Mike Fletcher Organization: Very Little Date: 26 Aug 1999 00:09:05 -0400 Message-ID: User-Agent: Gnus/5.070095 (Pterodactyl Gnus v0.95) XEmacs/20.4 (Emerald) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Well, I've gotten several mails indicating interest in my perl module. I've got a rough (*very rough*) patch ready and on the web: http://www.phydeaux.org/perl/zperl-0.01.patch.gz Something along the lines of the following should (in theory) get you a zperl.so that can be zmodload'd when run against a copy of the zsh-3.1.6 source tree: cd ..../zsh-3.1.6 gunzip < zperl-0.01.patch.gz | patch -p1 ./configure ... # may not be needed if already configured cd Src make modules # this will fail, see below cd Modules/zperl sh ./makezperl # this is a kludge cd Zsh # Then install the perl side of things perl Makefile.PL && make install As I said, it's rough at the moment. Any sugguestions how to get perl's cflags and ldflags into the mdd file in the correct way would be welcome (they're generated with something like: `perl -MExtUtils::Embed -e ccopts` and the objects="" setting didn't like having -lfoolib in it). There's not really any documentation to speak of, but the commands are (once you've done `zmodload zperl.so'): List any perl defined builtins commands zperl -l Have the perl interpreter require a perl module zperl -r Perl::Module Define a zsh builtin as a perl subroutine zperl -b foo Perl::Sub Undefine a builtin defined by zperl -b zperl -u foo I've been using a perl module along the following lines for testing. Put this in a file named Ztest.pm somewhere that perl can find it and do `zperl -r Ztest ; zperl -b perl_eval Ztest::eval'. You can then evaluate arbitrary perl code with the new `perl_eval' command. ---->8 Cut Here 8<---- package Ztest; use Zsh; sub eval { my $code = shift; eval " $code "; if( $@ ) { warn "Error during eval: $@\n"; return 1; } else { return 0; } } 1; __END__ ---->8 Cut Here 8<---- -- Fletch | "If you find my answers frightening, __`'/| fletch@phydeaux.org | Vincent, you should cease askin' \ o.O' 678 443-6239(w) | scary questions." -- Jules =(___)= | U