sans-clue has asked for the wisdom of the Perl Monks concerning the following question:
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 }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Run a subroutine in the background ?
by BrowserUk (Patriarch) on Nov 05, 2009 at 01:42 UTC | |
|
Re: Run a subroutine in the background ?
by llancet (Friar) on Nov 05, 2009 at 02:00 UTC |