• [^] # Re: Le troisième JOIN

    Posté par . En réponse au message Threads en Perl dans un CGI. Évalué à 3.

    Bin, euh, chez moi ça fonctionne ton truc.

    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"