Apr 8, 2014, 6:23 AM
Why are you using 'cp' and 'pkill' system calls? Are you not aware that perl has the built-in kill function to kill a process and the File::Copy module to copy files?
Re: [dwaynepeeters] Restart/reload an impress from Perl
The script is not "freezing". The system function forks a new (child) process to run the command and waits for that process to complete/exit before proceeding to the next statement.
If you want it to return immediately, you'll need to run libreoffice as a background process.
system("libreoffice —quickstart -show —norestore /home/picuntu/Desktop/Presentation.odp &");
A better method to do that would be to use the Proc::Background module.
my $cmd = "libreoffice —quickstart -show —norestore /home/picuntu/Desktop/Presentation.odp";
my $libreoffice = Proc::Background->new($cmd);
(This post was edited by FishMonger on Apr 8, 2014, 6:24 AM)