http://qs321.pair.com?node_id=1034405


in reply to Perl Crash attempting to run Tcl code

Maybe put die statements, like below, in different parts of your code to at least see what IS working before perl fails. Then you can narrow down the problem code.

die "I'm here in $self sub() at line ##.\n";

Sometimes, when you run code from the command line, rather from some other way of launching it, your @INC paths and environment variables might not be the same. Put this at the very top of your script and run in both scenarios:

use strict; use warnings; $|=1; # Buffering BEGIN { print "#### Environment Variables ####\n"; foreach (keys(%ENV)) { print "$_ = $ENV{$_}\n"; } print "#### \@INC ####\n"; foreach(@INC) { print "$_\n"; } die "#### \%ENV & \@INC: ####\n"; }

Anne

Replies are listed 'Best First'.
Re^2: Perl Crash attempting to run Tcl code
by bkobs39 (Acolyte) on May 21, 2013 at 12:37 UTC

    Thanks for the suggestion. I added the code and verified that the environmental variables are identical when I run with Perl's Tcl module and when I run the 'tclsh' and output with 'parray env'.

    Also, the point at which the script fails is here:

    $interp->Eval('set iw [dp_MakeRPCClient <ip> <port>]');