artemave has asked for the wisdom of the Perl Monks concerning the following question:
produces:use strict; use warnings; use XML::Simple; use Probe::ProbeUser; #uses base 'Class::DBI::MSSQL' use threads; my $config = XMLin('./probe.xml', ForceArray => 1); while (my ($type_name, $user_type) = each %{$config->{user}}) { for (my $i = 0; $i < $user_type->{quantity}; $i++) { threads->create( sub { my $user = Probe::ProbeUser->create( { pu_login => $user_type->{login}, pu_paswd => $user_type->{password}, pu_type => $type_name, } ); $user->execute(tasks => $user_type->{task}); } )->join(); } } __END__
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: dbi & threads
by Corion (Patriarch) on Jul 08, 2006 at 07:53 UTC | |
by artemave (Beadle) on Jul 10, 2006 at 16:05 UTC | |
by Corion (Patriarch) on Jul 10, 2006 at 16:13 UTC | |
|
Re: dbi & threads
by BrowserUk (Patriarch) on Jul 08, 2006 at 09:56 UTC | |
by renodino (Curate) on Jul 08, 2006 at 15:47 UTC |