sweetblood has asked for the wisdom of the Perl Monks concerning the following question:

I coded up a quick script to display a computer's name on the screen. It works just as intended on my system running the script from the command line or or double clicking it from explorer after running it through pp. But when I put it on a different machine it doesn't seem to do anything, I suspect it is throwing an error but I just can't see it.

The idea for this script is to have a quick command users here can just type into a windows search box ala "click start, type command, press enter" and have their computer's network name displayed.

If it helps here is the command line I used for pp.
"C:\Dwimperl\perl\site\bin\pp.bat" --output="C:\Dwimperl\perl\Script +s\myName.exe" --gui --compress 6 --bundle "C:\Dwimperl\perl\Scripts\m +yName.pl"
Anyone have any idea why this won't run as advertised?
#!/usr/bin/perl -w use strict; use Tk; use Sys::Hostname; my $hn = hostname; my $mw = MainWindow->new(); $mw->overrideredirect(1); $mw->Label(-text => "You Computer Name is: " . $/ . $hn, -font => "Arial 16")->pack; $mw->focusmodel('active'); Tk::after(10000, sub { $mw->destroy }); MainLoop();

Sweetblood

Replies are listed 'Best First'.
Re: Tk and Par pp missing window on windows 7
by dasgar (Priest) on Mar 19, 2015 at 23:32 UTC

    As for testing your executable, I'd recommend opening a command prompt and try running it from there. It's possible that by doing so, you may get to see any output that gets sent to STDERR. Otherwise, things may disappear before you get a chance to see them.

    Looking at how you're using pp, I suspect that may be the root of your issues. Look at the documentation for pp for more details about the available options. In particular, I'd recommend using -c and/or -x options. (NOTE: That's -c and -x, not -C and -X.) These options will try to "determine additonal run-time dependencies" and will package those into your executable. If you find out that you're still missing packages/libraries/files, you may need to use other options to explicitly add in those packages/libraries/files.