Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: par::packer with Tkx and Strawberry perl

by Anonymous Monk
on Jun 02, 2018 at 18:33 UTC ( #1215754=note: print w/replies, xml ) Need Help??


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

    PS.: the perl script in the example above is packed as follows: pp -l "C:/Tcl/bin/tcl86.dll" -l "c:/Tcl/bin/tk86.dll" -l "c:/Tcl/bin/zlib1.dll" -a "C:/Tcl;./" -o tktest.exe ./tktest.pl. Important is the period before "/". I don't know, why...

Re^2: par::packer with Tkx and Strawberry perl
by Anonymous Monk on Oct 14, 2019 at 17:20 UTC

    Thank you. The Tcl module is the worst documented module ever when it comes to instructions on how to bind a particular TCL/TK to a Perl script. Your solution for example doesn't seem to work if you are on Mac and you are using TCL/TK.Frameworks

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1215754]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2020-12-06 02:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (65 votes). Check out past polls.

    Notices?