Hi everybody,

Thanks for sending the reply  , but I think the problem is misunderstood
......thanks  to the stupid way I which I put forward my problem!!

this is our case ....

we  are trying to develop a Command line Interface for a simulator , the
requirements are that

the CLI as to be written in C
it should be able to run Perl commands and scripts from the prompt
..........this we have done by embedding a Perl interpreter into a C file and as
soon as the user types something at the prompt it is evaluated using eval(),
this keeps going on in an infinite loop inside the interpreter block until the
user types exit or terminates the program by any other means.  This way we are
able to maintain the values of all the variables till  program termination

if  the user says       ==> $a = "abc" ; print $a;
..  "==>"  is the prompt provided for input

this is how I evaluate it inside  my C file
perl_eval_pv("$temp = \"\$a = \"abc\"; print  \$a \"",TRUE);

perl_eval_pv("eval($temp);warn() if $@;",TRUE);



 here is where the problem starts  ( In highlighted line )

The CLI program has to be  a part of the main simulator process or else the
commands executed in the CLI would not have access to name spaces of all other
modules ..which is a basic necessity

so what we thought of was that  we would fork an Xterm just for I/O which would
communicate with  the parent process ( the process which has the Perl
Interpreter ) through pipes .

but since  eval writes its output to STDOUT we are not able to send it through
the pipe :-(

so my earlier effort was basically to find out how we can capture the output of
"eval($temp)"  into a Perl variable, ...this variable could later be taken from
the Perl stack ,converted into a C string and  sent  through the pipe to the
Xterm...............This $temp can contains any perl command.

 I think I have made my case clear

TIA,
-Mini.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to