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

Esteemed monks,

For some time I have been using PerlApp from the ActiveState Perl Dev Kit 6.0.0 for packaging Perl/Tk apps. It has worked extremely well. I ahve relied on the fact that if the resulting exe file was started from the command line that any 'debigging' information I produced with PRINT stratements would show up on the console.

But this has changed! Some time in the last few days I must have updated a modulem because now it doesn't do that. Trouble is that I don't know what I have done to change this behaviour.

Does anybody have any ideas how this may have changed? And how I might get back the behaviour I had previously.

jdtoronto

  • Comment on PerlApp or module change cuts print output!

Replies are listed 'Best First'.
Re: PerlApp or module change cuts print output!
by davidrw (Prior) on Aug 18, 2005 at 14:06 UTC
    what module did you upgrade? What else has changed in your script? Can you provide a small snippet that illustrates the problem? I also wonder if this is a case of buffering -- try putting $|=1; towards the top of your script (if that solves it, see The extremely simple buffering tutorial (really just an example) for more information).
      That is the problem, I don't know what I upgraded! I have been making additions to the code every day, and whist at one point the console window would show the print output, a few builds later it would not. Thanks for the buffering suggestion, I will try that.

      jdtoronto

Re: PerlApp or module change cuts print output!
by radiantmatrix (Parson) on Aug 18, 2005 at 15:31 UTC

    The ActiveState PDK has an option to compile a "GUI Application" (or some similar name, it's been a while). If this is checked, the compiled EXE will not open a console window.

    For GUI applications, it's actually kind of nice to hide the console window. For debugging, use a logger (Log::Log4Perl is nice), or use the debugger that comes with the ActiveState PDK to trace values.

    <-radiant.matrix->
    Larry Wall is Yoda: there is no try{} (ok, except in Perl6; way to ruin a joke, Larry! ;P)
    The Code that can be seen is not the true Code
    "In any sufficiently large group of people, most are idiots" - Kaa's Law
      I have been using the "GUI Application" feature since day one. I dont want the user to see the console window. But it has been useful to say to them, "open a console window, then run the programme, now tell me what you see".

      What I have done right now is to create a new Toplevel, with a text widget. The I tie STDOUT to that I I can get the output. It is actually nicer, because I can do that without having to have the user run the app from the console. I can control the presence or otherwise of the "debug" window from within the application.

      jdtoronto