Is the problem that you need to update your path in the script to include the packed location?
If so then something along the lines of the code below might be sufficient. It assumes the files are packed with the executable, so adjust paths as needed.
BEGIN { if ($ENV{PAR_0}) { use Config; $ENV{PATH} .= "$Config{path_sep}$ENV{PAR_TEMP}"; } #print $ENV{PATH}; };
Or, if they are in a directory at some arbitrary level above the script's location then something more complex like:
# not fully tested, not properly adapted to the Tk case, # and likely has side effects BEGIN { # Search up the tree until we find the tk dir that contains a bin + folder use Path::Class; use Config; use FindBin qw /$Bin/; #say "PAR_PROGNAME: $ENV{PAR_PROGNAME}"; my $prog_name = $ENV{PAR_PROGNAME} || $Bin; my @paths; use Config; my $tk_dir ='tk'; # add the tk bin dir to the path my $origin_dir = Path::Class::file($prog_name)->dir; ORIGIN_DIR: while ($origin_dir) { my $inner_path = Path::Class::dir($origin_dir, $origin_dir); #say "Checking $inner_path"; my $bin_path = Path::Class::dir($inner_path, 'bin'); if (-d $bin_path) { #say "Adding $bin_path to the path"; push @paths, $bin_path; } my $old_dir = $origin_dir; $origin_dir = $origin_dir->parent; last ORIGIN_DIR if $old_dir eq $origin_dir; } my $sep = $Config{path_sep}; $ENV{PATH} = join $sep, @paths, $ENV{PATH}; }
You could also try pp_simple if it's just the dynamic libs that need to be packed.
In reply to Re^5: making tcl.pm and Tcl movable
by swl
in thread making tcl.pm and Tcl movable
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |