#!/usr/bin/perl -- use threads; use threads::shared; my $foo = 0 x ( 100 * 1024 ); share($foo); threads->create(sub { $foo.= 1 x ( 100 * 1024); })->join(); sleep 10;