Most likely because the second snippet does an implicit
close $fh;
after the end of your program code and just before it starts to run the END block.
In reply to Re^2: how to kill background process when script exit?
by Corion
in thread how to kill background process when script exit?
by Allasso
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |