calling a php file from perl script..

Hi am new to perl script ..
i need some useful tutorials links to learn perl script..
and a sample script to call a php file from perl script..

thanks..

You can use any of the examples below

exec('scriptname.php'); # execute the script then exit
system('scriptname.php'); # Fork and wait while the child executes the script
my $output=`scriptname.php` # Fork and wait while the child executes the script then set the contents of $output to the output of the script

thanks ..
i used the function but dono whether my script is correct or not..

my perl script..

#!/usr/bin/perl
exec('/d01/user/sample.php');

my sample php file..

<?php
echo "testing";
?>

the result after executing my perl script...

/d01/user/sample.php: line 1: ?php: No such file or directory
testing
/d01/user/sample.php: line 3: syntax error near unexpected token `newline'
/d01/user/sample.php: line 3: `?>'

can u guide me where am i going wrong...

Hi.

Either try changing the call to the script to tell it to use PHP (i.e. 'php /d01/user/sample.php'), or add a "shebang" to the PHP script:

#!/usr/bin/php