in reply to par::packer with Tkx and Strawberry perl
Hello, All,
I know, this is an old discussion. But I struggled the last days with the same problem and think that I have found a clean solution.
Tcl doesn't find init.tcl, because the shell environment variable $ENV{TCL_Library} points to the wrong place, I think. Altering the environment variables of a parent process is not easy, but I think the following solution is the best and cleanest solution, if you don't want to use a tkkit.
You only have to add the following begin block to you Tcl::Tk or Tkx perl script:
BEGIN { if ($ENV{PAR_TEMP} && $ENV{TCL_Library} ne "$ENV{PAR_TEMP}/inc/lib +/tcl8.6") { print "Starting a Tcl::Tk PAR-exe file\n"; print "We need to set shell environment variables first \n"; + $ENV{TCL_Library} = "$ENV{PAR_TEMP}/inc/lib/tcl8.6"; # I don't know whether this is really necessary? $ENV{TK_Library} = "$ENV{PAR_TEMP}/inc/lib/tcl8.6"; system($0); exit(); } }
I hope, this will help someone.. It is really cool to distribute the perl/Tcl::Tk scripts with pp...
Best wishes,
Max
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: par::packer with Tkx and Strawberry perl
by Anonymous Monk on Jun 02, 2018 at 18:49 UTC | |
|
Re^2: par::packer with Tkx and Strawberry perl
by Anonymous Monk on Oct 14, 2019 at 17:20 UTC |