Retourner au contenu associé (entrée de forum : Threads en Perl dans un CGI)
Posté par gnujsa le 22 septembre 2005 à 15:14. En réponse au message Threads en Perl dans un CGI. Évalué à 3.
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
[^] # Re: Le troisième JOIN
Posté par gnujsa . En réponse au message Threads en Perl dans un CGI. Évalué à 3.
Pour diagnostiquer les erreurs tu peux t'aider des pragmas strict et diagnostics:
#!/usr/bin/perl -w
use strict;
use diagnostics;
use threads;
sub sub1 {
my @Parametres = @_;
return "\"@Parametres\"";
}
my $thr1 = threads->new(\&sub1, "linux");
my $thr2 = threads->new(\&sub1, "bsd");
my $thr3 = threads->new(\&sub1, "windows");
my $data1 = $thr1->join;
my $data2 = $thr2->join;
my $data3 = $thr3->join;
print "data1: $data1\ndata2: $data2\ndata3: $data3\n"
$ perl ./threads2.pl
data1: "linux"
data2: "bsd"
data3: "windows"