in reply to Re^4: Calling a PHP function from within Perl
in thread Calling a PHP function from within Perl

Did you use extract() right? This is a PHP function that loops through an associative array (think "hash" in Perl), and creates a local variable for each top-level key.

So instead of doing:

<?php $myarray = array( "foo" => 1, "bar" => 2, "baz" => 3, ); $foo = $myarray["foo"]; $bar = $myarray["bar"]; $baz = $myarray["baz"];

You can just do:

<?php $myarray = array( "foo" => 1, "bar" => 2, "baz" => 3, ); extract($myarray);

The keys will be case-sensitive, so make sure you're capitalizing them the same in the PHP and the Perl script that feeds it.

Alternatively, abandon using extract() and just access stuff in the array normally. I mostly only used extract() to keep the example PHP file I wrote very small and simple.