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 reply to Re: Running scripts normally without using shell? by jbert
in thread Running scripts normally without using shell? by newbie

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.