Home > Blockchain >  simultaneously need to exit current perl script while opening the pdf file
simultaneously need to exit current perl script while opening the pdf file

Time:05-24

I have a script to open the pdf file (Not in Adobe Acrobat application) instead Sumatra application (Pdf viewer).

system("start Sumatra C:/Users/test/Desktop/19June.pdf");
exit;

The problem is once we need to close the pdf file then only the script exited. But the requirement is the tool will be exit and not considered the opened pdf file.

CodePudding user response:

Use exec instead of system. exec replaces the current process with the one given, while system will start a new process and wait for it to exit.

  •  Tags:  
  • perl
  • Related