Is it possible that "bar" can be printed approx every 5 secs while "foo" approx every 60 ? I'm not actually printing of course, but I need this logic to work. Thankssub foo { sleep(60); print "foo\n"; } my $p = 50; while ($p > 5){ sleep(5); print "bar\n"; &foo; # do not wait for return please }
In reply to Run a subroutine in the background ? by sans-clue
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |