Just another Perl shrine | |
PerlMonks |
Re: Running scripts normally without using shell?by jbert (Priest) |
on Oct 15, 2006 at 09:57 UTC ( [id://578366]=note: print w/replies, xml ) | Need Help?? |
There are two ways (at least) of running processes on windows. In one, the process has the "standard" input, output and error streams (STDIN, STDOUT and STDERR). These have to have somewhere to go, and so windows has them run within a console window.
This mode most closely mimics the Unix background of perl's heritage and so this is the default behaviour of the perl interpreter (perl.exe) on windows. The other way of running a process on windows is for it to have its own window handling function (WinMain). In this case, the process doesn't have an associated console window (or STDIN, STDOUT and STDERR) and is able to create its own windows if it chooses. This is what the vast majority of 'normal' windows applications do. You can run your perl script in this second form by using the "wperl.exe" perl interpreter, which should be in the same place as your "perl.exe". But note - if you do this then you won't have any windows unless you create them and your script won't have the input output streams. i.e. you won't see anything (but if your script does other things - such as create files - you'll see the effects). So how do you create windows? Well, now you're in the territory of GUI programming. You can either try and drive the native windows UI via the Win32:: modules (which will be difficult and unrewarding I think) or use a GUI toolkit. The main choices of toolkit I know of are Gtk+, QT, WxWindows and Tk. All of these are cross-platform, which means your script should work with minimal changes on Linux and the Mac, which is always nice. Choosing between these GUI toolkits and their pros and cons is the subject of a node I now intend to create.
In Section
Seekers of Perl Wisdom
|
|