In Perl, the call System command has two situations, ' cmd ' and ' system ' cmd, their main difference being ' cmd ' will get the return result, and system "cmd" will directly output the result to the screen, for this difference has the following two kinds of usage:
1, when you need to get the results of the run, such as getting the current directory, it should be written chomp ($pwd = ' pwd '), if written $pwd = System "PWD", the $pwd value is 0. (The result of the chomp description of ' cmd ' here is that it contains a newline character, which you need to be aware of).
2, when you need to let some commands run in the background, you should use System "cmd", such as in the Perl design process, let a script run in the background while running the following command, at this time, if you use System "cmd&", the command will run in the background, Continue execution of the following statement. If you use ' cmd& ', although the & symbol is added, Perl will still wait for the command to return, not the effect of running in the background.
The difference between ' cmd ' and system ' cmd ' in Perl