One problem is that you don't call exit in your child process (i.e. at the end of if ( $pid == 0 ) { ... }). Adding that, the program behaves for me like (I think) what you want to achieve — though I'm not entirely sure I've understood correctly... (i.e. it reports to have detected CTRL-C, finishes whatever countDown loop it was in, then quits) With an existing /tmp/test.txt, that is — which you don't seem to create anywhere in the script itself. open(FH, "+<$testFile1") ... does not create the file, rather, it dies with "No such file or directory" if the file doesn't already exist. In this case, test1()/test2() won't ever be called. Likewise, the message "$testFile1 file CREATED\n" is kinda bogus, as it'll only be printed if the file already did exist...
In reply to Re: Call Intercepts
by almut
in thread Call Intercepts
by perlnewbie9292
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |