| CARVIEW |
Select Language
HTTP/2 200
date: Tue, 30 Dec 2025 15:17:36 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"5da4213c01ed867656e4cbeba6c2e17e"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com github.githubassets.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com marketplace-screenshots.githubusercontent.com/ copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com github.githubassets.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=jvRPTPAdloYi8bv9oW%2FDqsVA%2Biu%2FXN2Uwt7HkSxQ68Eo4LA64IVkU0kO2Fhy%2F79QByJUAAR2E%2FhztcfweLAvz%2FUKLEbRg4nVrFVHfx4LvDZ8tHSJvcrn0%2FiCjeUOqR%2BmnFoCIqkqMDg5mGUX6WIzWBLvKMmkcJDZuch7FaxlNB778pSycKsEikSn2AOxs1zIWto4eBo2txVkm3HDlw%2Bgm%2F1L%2FpaiosWgWM%2FTyY0WBwZ8rgZvNySnM%2FJaqFRIbDmVqV5jTkT2kqKroEI7O3YzrQ%3D%3D--l63qLSa4Tnlgn5%2Fs--QtlXWoLPe0xi%2FMCtLI%2BjWg%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.94252586.1767107856; Path=/; Domain=github.com; Expires=Wed, 30 Dec 2026 15:17:36 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Wed, 30 Dec 2026 15:17:36 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: B420:16C3C3:C8BB39:DBE9EB:6953ED10
GitHub - do-aki/php-ext-perl: This php extension embeds Perl Interpreter into PHP.
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 4
do-aki/php-ext-perl
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
What is ext/perl?
=================
This extension allows embedding of Perl Interpreter into PHP5 to:
* execute Perl files
* evaluate Perl code
* access values of Perl variables
* call Perl subroutines
* instantiate and manipulate of Perl objects
Requirements
============
PHP 5.0.0RC2 or later
Perl 5.8.0 or later
Quick install
=============
Step 1. Compile this extension. PHP_PREFIX and PERL_PREFIX mast point to real
PHP and Perl instalation prefixes.
export PHP_PREFIX="/usr"
export PERL_PREFIX="/usr"
$PHP_PREFIX/bin/phpize
./configure --with-perl=$PERL_PREFIX --with-php-config=$PHP_PREFIX/bin/php-config
make
Step 2. Install the extension (this step can require root privileges)
make install
Step 3. Add perl extension into your php.ini (this step can require root privileges)
extension=perl.so
Windows Installation Notes
==========================
Step 1. Download ActivePerl binaries for Windows from
https://www.activestate.com/Products/ActivePerl/
and install them.
Step 2. Put this extension into corresponding PHP source tree (into ext/perl)
Step 3. Compile the extension
SET PERL_HOME=C:\perl
msdev perl.dsp /MAKE "perl - Win32 Release_TS"
Step 4. Copy php_perl.dll (from Release_TS) to PHP extension dir
Step 5. Add perl extension into your php.ini
extension=php_perl.dll
PHP API
=======
new Perl()
----------
Creates perl interpreter. It allows
* reading and modifying of Perl variables
* calling Perl functions
* evaluating Perl code
* loading and executing exteranl Perl files
Examples:
$perl = new Perl();
var_dump($perl->x); // print scalar Perl variable - $x
var_dump($perl->array->x); // print array Perl variable - @x
var_dump($perl->hash->x); // print hash Perl variable - %x
$perl->func(); // call Perl function 'func' in void context
$x = $perl->func(); // call Perl function 'func' in scalar context
$y = $perl->array->func(); // call Perl function 'func' in array context
$y = $perl->hash->func(); // call Perl function 'func' in hash context
$perl->eval('use Digest::MD5');
echo $perl->{'Digest::MD5::md5_hex'}('Hello');
Perl->eval($perl_code)
----------------------
Evaluates Perl code and returns result. If Perl code is invalid it will
throw PHP exception.
Exampes:
$perl = new Perl();
$perl->eval('require "test.pl";');
echo $perl->eval($x.'+'.$y.';');
$perl->eval('$z='.$x.'+'.$y.';');
By default Perl code is evaluated in scalar context, but it can be
evaluated in array or hash context too.
Exampes:
$perl = new Perl();
$perl->eval('("a","b","c")'); // eval in void context
var_dump($perl->eval('("a","b","c")')); // eval in scalar context
var_dump($perl->array->eval('("a","b","c")')); // eval in array context
var_dump($perl->hash->eval('("a","b","c")')); // eval in hash context
Perl->require($perl_file_name)
------------------------------
Loads and executes Perl file. It doesn't return any value. If required Perl
file doesn't exist or invalid it will throw PHP exception.
Examples:
$perl = new Perl();
$perl->require('test.pl');
new Perl($perl_class_name[, $constructor = "new"[, ...]])
-----------------------------------------------------
Creates an instance of Perl class through calling specified constructor
or "new" if constructor is not specified. Additional parameters passed
to Perl's constructor. The created object allows:
* reading and modifying of object properties
* calling methods
* cloning
Examples:
$x = new Perl("Test");
$y = new Perl("Test","copy",$x);
$z = clone $y;
echo $z->property;
echo $z->method(1,2,3);
Methods can be called in array or hash context in the same way as Perl
functions, but all properties are acessable directly (without array or
hash modifiers).
Examples:
$x = new Perl("Test");
$x->f(); // call method "f" in void context
var_dump($x->f()); // call method "f" in scalar context
var_dump($x->array->f()); // call method "f" in array context
var_dump($x->hash->f()); // call method "f" in hash context
Known BUGS and limitations
==========================
* Perl objects passed between Perl and PHP by reference all other data type
(including arrays and hashes) passed by value. So modification of Perl's
arrays and hashes in PHP will not have effect in Perl.
$x = $perl->array->x;
$x[0] = 1; // Perl's array @x still unmodifyed
But you can use PHP references to do this. The following code works fine.
$x = &$perl->array->x;
$x[0] = 1; // Modifies Perl's array @x
* pecl/perl can't call internal Perl functions
(print, die, ...).
This extension was testd on RedHat Linux 9.0 with PHP 5.0.0RC2-dev (non ZTS build)
and perl-5.8.0 (installed from RPM) and on Windows 2000 with PHP-5.0.0RC2-dev
(ZTS build) and perl-5.8.0.
About
This php extension embeds Perl Interpreter into PHP.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
You can’t perform that action at this time.