my $thread1 = $thread->create(sub { print "I am a thread1"},$variable1); my $thread2 = $thread->create(sub { print "I am a thread2"},$variable2);