Name
async
Synopsis
$t
= async {block
};
Creates a new thread to execute the block that follows it.
The block is treated as an anonymous subroutine (and therefore has
a semicolon after the closing bracket). Returns a thread object.
async
isn’t exported by
default, so you can specify use
Thread qw(async);
or fully
qualify the name (Thread::async
).
Get Perl in a Nutshell, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.