Here's how you can do it using threads, assuming that your Perl has threading built in. (run perl -V to check if you can use threads (look for usethreads=define)).
#!/usr/bin/perl use strict; use warnings; use threads; foreach (0..100) { # create a thread to call the "run_system" subroutine # to run "ls -la" on the OS my $thread = threads->create("run_system", "ls -la"); $thread->detach; } sub run_system { my $cmd = shift; system($cmd); } __END__
In reply to Re: Fork/Child Question
by beable
in thread Fork/Child Question
by EchoAngel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |