Python + perl and more

Gisle Aas gisle at ActiveState.com
Fri Aug 18 05:43:15 EDT 2000


dkuhlman at netcom.com (G. David Kuhlman) writes:

> This is probably a little into the future, but you may want take a
> look at:
> 
>     http://www.zope.org/Wikis/zope-perl/FrontPage
> 
> If you follow the link in this page to the FAQ, it says that this
> Python to Perl connection will be usable outside of Zope.  (But, if
> I were you, I wouldn't bet my project on this until you've looked
> at it pretty closely.)

The perl embedding is indeed usable outside Zope.  Using CPAN modules
from python works pretty well already.  But the code is still alpha
and some things in the programming interface is still likely to change.

You can check out the actual code at
        http://www.ActiveState.com/download/Zope-Perl/

This is a little example showing use of the Digest::MD5 perl module
from python:

$ python
Python 1.5.2 (#3, Jun  5 2000, 20:59:58)  [GCC egcs-2.91.66 19990314/Linux (egcs- on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import perl
>>> perl.require("Digest::MD5")
1
>>> perl.call("Digest::MD5::md5_hex", "abc")
'900150983cd24fb0d6963f7d28e17f72'
>>> md5 = perl.get_ref("Digest::MD5::md5_hex")
>>> md5("abc")
'900150983cd24fb0d6963f7d28e17f72'

-- 
Gisle Aas



More information about the Python-list mailing list