biswajit has asked for the wisdom of the Perl Monks concerning the following question:

Is it possible to run a tcl program within a perl program, if yes can you tell me how it is possible?
  • Comment on How to run a tcl program within a perl program.

Replies are listed 'Best First'.
Re: How to run a tcl program within a perl program.
by kvale (Monsignor) on Sep 01, 2005 at 06:05 UTC
    The Tcl module allows one to start a Tcl interpreter within a perl program and execute Tcl code. Alternatively, one could simply execute a tcl program via a system function:
    system "tclsh file.tcl";

    -Mark

Re: How to run a tcl program within a perl program.
by Plankton (Vicar) on Sep 01, 2005 at 06:01 UTC

    Sure there are a lot of ways ...

    system ( "yourprog.tcl");

    ... or maybe something like this ...

    open TCL, "|tcl" or die "cannot start tcl:$!\n"; print TCL <<CODE; some tcl command other tcl command CODE close TCL

Re: How to run a tcl program within a perl program.
by philcrow (Priest) on Sep 01, 2005 at 13:53 UTC
    You might like these other solutions: Tcl which has a syntax like:
    use Tcl; $interp = new Tcl; $interp->Eval('puts "Hello world"');
    or Inline::Tcl which has a more traditional Inline approach. In it, you define Tcl functions in your Perl program and call them as if they were pure Perl, like so:
    use Inline Tcl => <<END ... your tcl function definitions here END my $answer = tcl_function(@args);

    Phil