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

Hello Monks,

Can command line switches be used with compiled Perl2Exe apps to get user input?
If so what is the syntax required in the Perl?

e.g. c:\MyBinary.exe -f foo -b bar

many thanks.

Replies are listed 'Best First'.
Re: Command line switches with Perl2Exe
by marto (Cardinal) on Nov 09, 2007 at 11:56 UTC
    To answer your question with another question, have you tried it? It should not take you long to write a short perl example, use Perl2Exe (assuming you have it) to convert it to an executable and test it. Failing that check the Perl2Exe documentation. I am sure you could have found the answer by trying a short example in less time that it would take to get a response here.

    Hope this helps

    Update: slight rewording

    Martin
      Thanks for the response
      Yes I have - I currently have a script that requires two input variables from the user. These are gathered using STDIN in perl world.
      However I need to compile this to a Windows binary - which works, but the program runs as usual (as you would expect) where the app waits for the input on the command line.

      e.g. c:\MyBinary.exe <CR>parameter1<CR>parameter2<CR>output!

      I need it to accept switches as per my previous example.

      I do realize this is a lame question from a Perl newbie - but I have been searching for this information for several hours without success (including the docs for perl2exe, the lama and Perl Monks - if this is not a suitable question for this board I apologise.
        Okay I answered my own question eventually.
        For any other new folks - it looks like the module Getopt::Std will do the trick.