I'd give up Perl tomorrow if only...

Richard Barrett R.Barrett at ftel.co.uk
Mon Jun 24 10:51:52 EDT 2002


At 09:40 24/06/2002 -0400, Michael Chermside wrote:
>Michael Chermside wrote:
> > Where can I find the pyperl module?
>
>Gerhard Häring responded:
>>Google - Enter "pyperl" - then hit "I feel lucky" :-)
>>This will bring you to
>>http://www.cpan.org/modules/by-module/LWP/GAAS/pyperl-1.0.readme which 
>>looks to
>>a non-Perl guy like me that its available as a CPAN module.
>
>Well, I had tried that, but (not being a perl kind of guy) I'm not really 
>sure what a CPAN module is or how to obtain or download it. I DID find 
>some version of pyperl at ActiveState (yeah, ActiveState!), but couldn't 
>(in the brief amount of time I spent on it) figure out how to set it up.
>
>What I WAS able to figure out has been written up at 
>http://www.faqts.com/knowledge_base/view.phtml/aid/17202/fid/1102
>If anyone else can help more, let me know.
>
>-- Michael Chermside

I was following this thread with interest. As a result I downloaded 
http://downloads.activestate.com//Zope-Perl/pyperl-1.0.1.tar.gz last Friday.

Having unpacked the .tar.gz I did just what it said in the README:

<quote>
Build instructions:

   - make sure your PATH is set up so that 'perl' and 'python'
     reference the versions of the language interpreters that you
     want to use.

   - If you are using Python-1.5.2, then you need to install
     the Distutils package version 0.9 or better first.

   - Run these commands:

       (cd Python-Object; perl Makefile.PL; make install)
       python setup.py install

   - You should now be able to run the test.py test script.

       python test.py

</quote>

The only snag was quickly fixed by renaming the file MULTI_PERL to 
xMULTI_PERL to indicate that my Perl installation hadn't been build with 
-Dusethreads option.

All working in less than half an hour on my Linux desktop with Python 2.2.1 
and Perl 5.6.1.

Say 'import perl' in your Python code and you have a pretty seamless way of 
using Perl modules from Python. Wonderful for using that legacy code and 
particularly for using a Perl module for which you cannot find a Python 
equivalent ready to hand.

As an old Perl hand who these days much prefers Python but cannot always 
escape history, I am mightily impressed. That said both Python and more 
recently Perl are pretty good at embedding and extending so I should not be 
as impressed as I am that it works so nicely.

While I've not given it a real thrashing yet, the implementation seemed 
pretty solid to me.

Many thanks to the folks at ActiveState who I gather did the embedding work.

Definitely recommended for the compleat script-writer's use. All I have to 
do now is see how it all interacts with Tk/Tcl :)






More information about the Python-list mailing list