Clear questions and runnable code
get the best and fastest answer
STDOUT and a PAR --gui executableby crabbdean (Pilgrim)
|on Apr 12, 2004 at 14:40 UTC||Need Help??|
crabbdean has asked for the
wisdom of the Perl Monks concerning the following question:
I've created a program that accepts commandline paramaters at runtime. One of these is to create a log file, another is to set verbose mode so that output is put to STDOUT instead of the logfile. Another flag "--help" outputs help to the STDOUT. 'print' statements are to the filehandle LOGFILE that I duplicate to STDOUT if the verbose flag is set. (see code below).
As a perl .pl this all works fine.
I then compile this script into a PAR archive executable using the --gui option so that there is no console when running the executable (I need it like this because I don't want a console). Now I know that with the --gui option it doesn't create a console, but I thought when running it from a command line you'd still get the output to STDOUT (and I do need this STDOUT functionality)
So I'm guessing two possible causes:
1. PAR --gui suppresses STDOUT completely.
2. OR, I've opened the duplicate filehandle to STDOUT incorrectly (although it does work as a .pl and when simply PAR'ed (without --gui) but not when compiled as PAR --gui
If No. 1 is true, then I need to find out how to suppress the console from a perl EXE and still get STDOUT if run from a command line. Anybody know how to do this or what's going on?
The Funkster of Mirth
Programming these days takes more than a lone avenger with a compiler. - sam
RFC1149: A Standard for the Transmission of IP Datagrams on Avian Carriers