PLDelphi - This project will embed Perl into Delphi.
program ConsoleTest; {$APPTYPE CONSOLE} uses SysUtils, PLDelphi_dll ; var browser , response : SV ; begin Perl.use('WWW::Mechanize'); browser := Perl.NEW('WWW::Mechanize'); response := browser.call_sv('get',' "http://www.perl.com/" ') ; writeln( response.call('content') ) ; FreeAndNil(response) ; FreeAndNil(browser) ; end.
Home:
http://www.borland.com/
http://www.perl.com/
Download from:
http://www.activestate.com/Products/Download/Download.plex?id=ActivePerl
http://www.activestate.com/Solutions/Programmer/Perl.plex
First install Delphi and Perl binaries.
You also will need to have Perl binaries in the search PATH:
PATH=C:\Perl\bin\;%PATH%
After have the binaries well installed just type:
Perl MakeFile.PL nmake
Then you should compile the ConsoleTest test project in Delphi (ConsoleTest.dpr). After this you are able to run the ConsoleTest.exe example.
Note that after build PLDelphi you will have a ./built directory with all the files needed to be with your Delphi application. In this directory you also will have the ConsoleTest.exe example to test it in this directory.
Note that maybe you will need to copy by hand Perl56.dll to the ./built directory to have full standalone version of PLDelphi (without the need to install Perl).
Enjoy!
To use PLDelphi from your Delphi application without need to install Perl you will need this files in the main diretory of your application:
PLDelphi.dll ## The PLDelphi library that loads the Perl interpreter. PLDelphi.pm ## Perl side of PLDelphi. Perl56.dll ## The Perl library in case that you have Perl built dynamic. PLDelphi_dll.pas ## PLDelphi classes and DLL wrapper. lib/* ## A Perl lib directory with basic .pm files (strict, warnings, etc...)
Take a look in the ./built directory after build PLDelphi.
You will need to have VC++ 6 to compile PLDelphi, since your Perl version for Win32 (from ActiveState) will be probably compiled with VC++, and we need the same compiler of the interpreter to embed a Perl program.
I haven't ported it to Linux yet. Help welcome!
Note that if you are compiling PLDelphi with Perl 5.8+ you can use Perl Threads too.
PLJava, LibZip, PAR.
Graciliano M. P. <gm@virtuasites.com.br>
I will appreciate any type of feedback (include your opinions and/or suggestions). ;-P
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install PLDelphi, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PLDelphi
CPAN shell
perl -MCPAN -e shell install PLDelphi
For more information on module installation, please visit the detailed CPAN module installation guide.