Question

I am new to Linux environment. I run a sample system command. I am getting the error as "cannot execute binary file". I run the same program in windows but i used batch file to execute exe file. I need to do the same program in linux environment.

sample code:
use strict;
use warnings;
system("/apps01/try.exe");

In this, I need to run the exe file and it should wait till the execution completes.Also i tried,

bash-3.2$sudo perl sample.pl 
/apps01/try.exe: /apps01/try.exe: cannot execute binary file.
Was it helpful?

Solution

If you try to Start an .exe-Application on an Unix-Machine, you need Wine (http://www.winehq.org/). Than should the System-Call work

OTHER TIPS

You're already running the script but try.exe is a Windows executable (plus not found on your linux machine).

Try to run something else.. something executable if you intend to use that function, e.g.

#!/usr/bin/perl
use strict;
use warnings;
my $status = system("vi");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top