From: Mike Fletcher <fletch@phydeaux.org>
To: zsh-workers@sunsite.auc.dk
Subject: Zsh perl module
Date: 26 Aug 1999 00:09:05 -0400 [thread overview]
Message-ID: <m2r9krgp3y.fsf@godzilla.phydeaux.org> (raw)
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
reply other threads:[~1999-08-26 4:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2r9krgp3y.fsf@godzilla.phydeaux.org \
--to=fletch@phydeaux.org \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).