asdf asdf - 13 days ago 7
Perl Question

How to open xlsx file withough hanging a perl process

I am trying to open a xlsx file in a Perl script with the command :

system("path_to_file\\file.xlsx");


The file is opened but it keeps the perl process hanged until I close the .xlsx file. How can I avoid that?

The file
file.xlsx
is created in the perl script. At the end of the execution I want it to be displayed to the user (like you would manually open it) and it works but it keeps the perl process hanging until i close it.

Answer

On Windows, system(1, $cmd) will run the command and immediately return without waiting for the child to finish. See perlport.

On Unix, fork and exec will work to this end.