my $x = 5; sub ct { threads->create(\&worker); } #### sub ct { my $x = 5; threads->create(\&worker); }