Is it possible
If so, how the heck would you do it.
I have an encryption/decryption function in php using mcrypt. My perl version doesn't support the older mcrypt modules for it. So I couldn't convert the functions to perl, so I want to use it directly.
using a php class in perl
Moderator: General Moderators
- thomas777neo
- Forum Contributor
- Posts: 214
- Joined: Mon Mar 10, 2003 6:12 am
- Location: Johannesburg,South Africa
write the complete script in php, and then call it from perl with system/exec...
Code: Select all
@result = `php somescript.php`;- thomas777neo
- Forum Contributor
- Posts: 214
- Joined: Mon Mar 10, 2003 6:12 am
- Location: Johannesburg,South Africa
Code: Select all
@result = `php somescript.php`;Code: Select all
class exampleClass
{
function example($exampleVar)
{
return trim($exampleVar);
}
}Apologies, if it is a stupid question (I see that it puts the command output into an array, I don't know what to do with it afterwards)
could would look like (untested)
Code: Select all
require_once('example.class.php');
$example = new example;
$result = $example->example($argv[1]);
echo $resultCode: Select all
#!/usr/bin/perl -w
@result = `php-cli somescript.php somevalue`;
print $resultї0];