#!/usr/bin/env perl use strict; use warnings; use threads; #### while () { threads->create(sub { print 'Thread ', threads->tid, ': ', $_ })->join; } #### __DATA__ list.txt line 1 list.txt line 2 list.txt line 3 #### Thread 1: list.txt line 1 Thread 2: list.txt line 2 Thread 3: list.txt line 3