Php and Perl please help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nriv08
Forum Newbie
Posts: 3
Joined: Wed Aug 20, 2008 11:33 am

Php and Perl please help

Post by nriv08 »

I have a php script that has the session id number and i want to send this variable to perl. I am having trouble sending it.

Php script:

<?php

set_time_limit(0);
session_start();
$session = session_id(); #TRYING TO SEND "$session" to Perl Script

$session . ' ' . $fileLine2;

shell_exec("second_one.pl" . " -s " . $session);

?>

Perl Script:

use Getopt::Std;

getopts("s:", \%option);
$session_num = '';

if ($option{s}){
$session_num = $option{s};
}

I don't know where i'm goin wrong.

Help please.
User avatar
andyhoneycutt
Forum Contributor
Posts: 468
Joined: Wed Aug 27, 2008 10:02 am
Location: Idaho Falls

Re: Php and Perl please help

Post by andyhoneycutt »

are you getting any errors? if so, please post them.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Php and Perl please help

Post by VladSun »

Try using absolute path to your Perl script in shell_exec.
Also, is your Perl script executable? 0755 and shebang line?

PS: In fact, if your Perl script is not reachable through your PATH env var, it won't get executed event if it was in the current directory...
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply