{"id":13780214,"url":"https://github.com/do-aki/php-ext-perl","last_synced_at":"2026-01-10T08:47:17.370Z","repository":{"id":4825128,"uuid":"5978990","full_name":"do-aki/php-ext-perl","owner":"do-aki","description":"This php extension embeds Perl Interpreter into PHP.","archived":false,"fork":false,"pushed_at":"2021-05-10T18:14:38.000Z","size":162,"stargazers_count":12,"open_issues_count":2,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-03T18:14:53.459Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/do-aki.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-09-27T07:55:03.000Z","updated_at":"2023-02-10T11:44:39.000Z","dependencies_parsed_at":"2022-08-17T23:35:20.798Z","dependency_job_id":null,"html_url":"https://github.com/do-aki/php-ext-perl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/do-aki%2Fphp-ext-perl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/do-aki%2Fphp-ext-perl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/do-aki%2Fphp-ext-perl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/do-aki%2Fphp-ext-perl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/do-aki","download_url":"https://codeload.github.com/do-aki/php-ext-perl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225056775,"owners_count":17414206,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T18:01:13.397Z","updated_at":"2026-01-10T08:47:17.322Z","avatar_url":"https://github.com/do-aki.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"What is ext/perl?\n=================\n\n  This extension allows embedding of Perl Interpreter into PHP5 to:\n    * execute Perl files\n    * evaluate Perl code\n    * access values of Perl variables\n    * call Perl subroutines\n    * instantiate and manipulate of Perl objects\n\nRequirements\n============\n  PHP 5.0.0RC2 or later\n  Perl 5.8.0 or later\n\nQuick install\n=============\n\n  Step 1. Compile this extension. PHP_PREFIX and PERL_PREFIX mast point to real\n          PHP and Perl instalation prefixes.\n\n    export PHP_PREFIX=\"/usr\"\n    export PERL_PREFIX=\"/usr\"\n    $PHP_PREFIX/bin/phpize\n    ./configure --with-perl=$PERL_PREFIX --with-php-config=$PHP_PREFIX/bin/php-config\n    make  \n\n  Step 2. Install the extension (this step can require root privileges)\n\n    make install\n\n  Step 3. Add perl extension into your php.ini (this step can require root privileges)\n\n    extension=perl.so\n\nWindows Installation Notes\n==========================\n\n  Step 1. Download ActivePerl binaries for Windows from \n          http://www.activestate.com/Products/ActivePerl/\n          and install them.\n\n  Step 2. Put this extension into corresponding PHP source tree (into ext/perl)\n\n  Step 3. Compile the extension\n\n    SET PERL_HOME=C:\\perl\n    msdev perl.dsp /MAKE \"perl - Win32 Release_TS\"\n\n  Step 4. Copy php_perl.dll (from Release_TS) to PHP extension dir\n\n  Step 5. Add perl extension into your php.ini\n\n    extension=php_perl.dll\n\nPHP API\n=======\n\n  new Perl()\n  ----------\n    Creates perl interpreter. It allows\n\n    * reading and modifying of Perl variables\n    * calling Perl functions\n    * evaluating Perl code\n    * loading and executing exteranl Perl files\n\n    Examples:\n      $perl = new Perl();\n      var_dump($perl-\u003ex);        // print scalar Perl variable - $x\n      var_dump($perl-\u003earray-\u003ex); // print array Perl variable - @x\n      var_dump($perl-\u003ehash-\u003ex);  // print hash Perl variable - %x\n      $perl-\u003efunc();             // call Perl function 'func' in void context\n      $x = $perl-\u003efunc();        // call Perl function 'func' in scalar context\n      $y = $perl-\u003earray-\u003efunc(); // call Perl function 'func' in array context            \n      $y = $perl-\u003ehash-\u003efunc();  // call Perl function 'func' in hash context\n\n      $perl-\u003eeval('use Digest::MD5');\n      echo $perl-\u003e{'Digest::MD5::md5_hex'}('Hello');\n\n  \n  Perl-\u003eeval($perl_code)\n  ----------------------\n    Evaluates Perl code and returns result. If Perl code is invalid it will\n    throw PHP exception. \n\n    Exampes:\n      $perl = new Perl();\n      $perl-\u003eeval('require \"test.pl\";');\n      echo $perl-\u003eeval($x.'+'.$y.';');\n      $perl-\u003eeval('$z='.$x.'+'.$y.';');\n\n    By default Perl code is evaluated in scalar context, but it can be \n    evaluated in array or hash context too.\n\n    Exampes:\n      $perl = new Perl();\n      $perl-\u003eeval('(\"a\",\"b\",\"c\")');                  // eval in void context\n      var_dump($perl-\u003eeval('(\"a\",\"b\",\"c\")'));        // eval in scalar context\n      var_dump($perl-\u003earray-\u003eeval('(\"a\",\"b\",\"c\")')); // eval in array context\n      var_dump($perl-\u003ehash-\u003eeval('(\"a\",\"b\",\"c\")'));  // eval in hash context\n\n\n  Perl-\u003erequire($perl_file_name)\n  ------------------------------\n    Loads and executes Perl file. It doesn't return any value. If required Perl\n    file doesn't exist or invalid it will throw PHP exception.\n\n    Examples:\n      $perl = new Perl();\n      $perl-\u003erequire('test.pl');\n\n  new Perl($perl_class_name[, $constructor = \"new\"[, ...]])\n  -----------------------------------------------------\n    Creates an instance of Perl class through calling specified constructor\n    or \"new\" if constructor is not specified. Additional parameters passed\n    to Perl's constructor. The created object allows:\n\n    * reading and modifying of object properties\n    * calling methods\n    * cloning\n\n    Examples:\n      $x = new Perl(\"Test\");\n      $y = new Perl(\"Test\",\"copy\",$x);\n      $z = clone $y;\n      echo $z-\u003eproperty;\n      echo $z-\u003emethod(1,2,3);\n\n    Methods can be called in array or hash context in the same way as Perl\n    functions, but all properties are acessable directly (without array or\n    hash modifiers).\n\n    Examples:\n      $x = new Perl(\"Test\");\n      $x-\u003ef();                  // call method \"f\" in void context\n      var_dump($x-\u003ef());        // call method \"f\" in scalar context\n      var_dump($x-\u003earray-\u003ef()); // call method \"f\" in array context\n      var_dump($x-\u003ehash-\u003ef());  // call method \"f\" in hash context\n\n\n\nKnown BUGS and limitations\n==========================\n  *  Perl objects passed between Perl and PHP by reference all other data type\n     (including arrays and hashes) passed by value. So modification of Perl's\n     arrays and hashes in PHP will not have effect in Perl.\n\n     $x = $perl-\u003earray-\u003ex;\n     $x[0] = 1; // Perl's array @x still unmodifyed\n     \n     But you can use PHP references to do this. The following code works fine.\n     \n     $x = \u0026$perl-\u003earray-\u003ex;\n     $x[0] = 1; // Modifies Perl's array @x\n\n  *  pecl/perl can't call internal Perl functions\n     (print, die, ...).\n\nThis extension was testd on RedHat Linux 9.0 with PHP 5.0.0RC2-dev (non ZTS build)\nand perl-5.8.0 (installed from RPM) and on Windows 2000 with PHP-5.0.0RC2-dev\n(ZTS build) and perl-5.8.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdo-aki%2Fphp-ext-perl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdo-aki%2Fphp-ext-perl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdo-aki%2Fphp-ext-perl/lists"}