use threads; my $var = "works"; thread->new(\&sub1); sub sub1 { }