in reply to Re: Invoking a perl program via an executable c++ program...
in thread Invoking a perl program via an executable c++ program...

Thanks :) At the moment, the perl program I've coded is invoked at the command line. I want to make it easier for others to use it by double-clicking a c++ program with the extension .exe. Can I do that with just perl itself or do I need to use c++ to write the so called interface?
  • Comment on Re: Re: Invoking a perl program via an executable c++ program...

Replies are listed 'Best First'.
Re: Re: Re: Invoking a perl program via an executable c++ program...
by John M. Dlugosz (Monsignor) on Nov 14, 2001 at 21:19 UTC
    You can double-click on files with .pl, .perl, .wperl, etc. if you want. The GUI shell should ask you what to do the first time you try.

    I'm guessing you want to hide the console output and have the wrapper use a Window instead? Use wperl (or is it perlw?) .exe instead of perl.exe to run the script.

    —John

Re: Re: Re: Invoking a perl program via an executable c++ program...
by brianarn (Chaplain) on Nov 14, 2001 at 22:59 UTC
    If you're using ActiveState's Perl distro, under the Perl\bin dir there's a runperl.bat. If you copy that file to the same directory that your perl script is in, and rename the .bat file to have the same name as the perl script (ex: if your perl script is 'program.pl', rename the .bat file to 'program.bat') - then someone at a command prompt should be able to just type 'program' or whatever the name of the script is to execute it.

    Of course, windows should have associated the .pl extension to Perl as John mentioned, so you should just be able to double-click on the file itself. in windows. :)

    ~Brian
      I need the user to key in some inputs (arg1 and arg2) after the program is invoked (i.e. he or she need only to specify the arguments but not type out the entire command as in c:\perl>perl program.pl arg1 arg2). Ideally, I would like to have the user simply select the options (the arguments) through a GUI interface without having to type at the command line. Can that be done with perl alone or do I need to use c++ to do the interface? Thanks in advance.
        use perl's TK module. A brief example here