On 11/6/06, Peter Gordon <[EMAIL PROTECTED]> wrote:
>  has Scalar/Util.pm (and also Scalar/Util.so or Scalar/Util.dll) been 
packaged,
>   run "unzip -l your_executable" to check
# unzip -l app_diag.exe | grep Util
56:     2050  11-06-06 08:21   lib/List/Util.pm
61:     3572  11-06-06 08:21   lib/Scalar/Util.pm
117:        0  11-06-06 08:21   lib/auto/List/Util/Util.bs
118:    32871  08-29-06 12:49   lib/auto/List/Util/Util.dll
119:      789  08-29-06 12:49   lib/auto/List/Util/Util.exp

OK, they are in the zip part (but stale copies might also be in the
"embedded" stuff
of the executable). Could you run the attached script on app_diag.exe and
check whether the extracted Util.* stuff matches your installed stuff
(pm's might have comments/pod stripped, that's normal).

> - did you build PAR yourself (esp. on Windows) on the computer where you
>   did the pp'ing?
Yes

... and with the version of perl and Scalar::Util that is now installed?

There is an odd thing that I noticed in Archive::Tar.pm, which may
provide a clue to what is happening.

BEGIN {
    use Config;
    $HAS_PERLIO = $Config::Config{useperlio};

    ### try and load IO::String anyway, so you can dynamically
    ### switch between perlio and IO::String
    eval {
        require IO::String;
        import IO::String;
    };
    $HAS_IO_STRING = $@ ? 0 : 1;

Shouldn't be a problem.

> > 1. Besides adding lots of print statements, is it possible to debug a pp
> > package?
>
> Sorry, no, because you can't pass the "-d" switch down to the packaged
> version of perl.
>
If I unpack the files, is it then possible to use -d somehow?

Again no, because it is using a custom-built perl interpreter that does not
obey the -d switch (and has no other way to enable debug mode):

I also have another problem: I run external programs using backticks and
pack without using the --gui flag. When the user double clicks on the
file name a dos box shows. With the --gui flag, no dos box shows, but on
the other hand, every time I run the backticks, a dos box starts up and
closes down, which appears as a flashing dos box to the user. This does
not happen without pp.

I know that one, but see no easy fix.

What happens is this:
- programs started with backticks need to run in
 a "DOS box", otherwise Windows won't endow them with stdin/stdut/stderr
- the perl runtime knows about this and will start the program in a DOS box
 if itself isn't runing in one already
- so without --gui, you already got one, no need to create any for backticks
 (but of course the users sees the initial DOS box)

You could try what happens for system() (don't remember). If  system() doesn't
flash a DOS box with --gui, you could replace the backticks by using
IPC::Run3 (that allows you to catch stdout/stderr into a string, but way more
flexible as backticks), because it uses system() internally.

If system() doesn't work, maybe some advanced use of Win32::Process and/or
Win32::Console might to the trick?

Cheers, Roderich

Attachment: extract-embedded.pl
Description: Perl program

Reply via email to