#!/usr/bin/perl use threads; use strict; my $thr = threads->new(\&sub1); sub sub1 { print "hi from thread"; } #### my $thr = threads->new(\&sub1); sub sub1 { my $self_thread = $(this); #I know this is absolutely wrong just trying to make you understand what I want print "hi from thread $self_thread"; }