In Perl, you can determine if a script is being executed in another script (presumably through systemor qx)?
$ cat foo.pl
print "foo";
print "\n" if not $in_qx;
I understand that this is not applicable if the script was executed through exec.
I know exactly what systemstarts the process like fork, and I know that it forkcan return a value that is variable depending on whether you are in the parent or child process. I don’t know about qx.
Regardless, I'm not sure how to determine if I have an forked process without actually executing fork.
Danny source
share