Help for this page

Select Code to Download


  1. or download this
    $ perl -Mthreads -e'my $t = async { die "Foo" }; $t->join; say "done"'
    Thread 1 terminated abnormally: Foo at -e line 1.
    done
    
  2. or download this
    $ perl -Mthreads -E'my $t = async { "code" }; $t->join; say "done"'
    done
    
  3. or download this
    $ perl -Mthreads -E'sub t { "code" } my $t = async { t(); warn("return
    +ed"); }; $t->join; say "done"'
    returned at -e line 1.
    done
    
  4. or download this
    $ perl -Mthreads -E'sub t { "code" } my $t = async { threads->exit(); 
    +}; $t->join; say "done"'
    done
    
  5. or download this
    $ perl -Mthreads -E'my $o = \&threads::exit; *threads::exit = sub { wa
    +rn "exit"; $o->(@_) }; my $t = async { threads->exit(); }; $t->join; 
    +say "done"'
    exit at -e line 1.
    done