April 22nd, 2013, 12:47 AM
Execution of different Perl exe in single exe
I have done 3 projects. Each one is different from other.
Now my customer wants to make it as generic.
I have 3 .exe files for 3 projects.
My idea is Using GUI we can select the corresponding project and execute that .exe file alone. Is it possible to do it?
Thanks for u r reply in advance.
Thanks & Best Regards,
April 22nd, 2013, 02:29 AM
Of course it is possible. But do you want to do that in Perl?
April 22nd, 2013, 04:05 AM
I want to do this in Perl only.
What my idea is create some GUI, in that it should ask which file should be executed? Like that.... Is it possible to implement?
Can u just explain me briefly if u know how to do it?
I am beginner of Perl.
April 22nd, 2013, 05:34 AM
The way to execute an executable program from a Perl script will depend on whether you want the script to get data returned by this program or not, and also whether you want the script to wait for the exe program to complete or not.
The basic three ways to do it are:
As for the GUI, I haven't used the Perl TK GUI for about 10 years, I would not be able to help at this point (there are also other GUI toolkits, but I do not know them), but I know it is not very difficult for a task as simple as what you want to do.
my $return_status = system "program.exe"; # waits for the return status of the exe programe
exec "program.exe"; # ends the execution of the current Perl script
my @prog_output = `program.exe`;