#!/usr/bin/perl -w use threads; my @threads; @threads for my $i (1..3) { push @threads, threads->create(\&get_now, $i); } foreach my $thread (@threads) { $thread->join(); } sub get_now { my $num = shift; print "thread ", $num, " => ", time(), "\n"; sleep 1; }
->