in reply to Re^2: Passing self to process as reference
in thread Passing self to process as reference
That helped a lot. The reason you are getting a wierd result is that you need to call my $thread = new Thread \&processJobs, @paramters (omit the \ before @paramters).
When you pass \@paramters to the Thread constructor processJobs gets \@paramters passed, as is, as the first parameter, not $self. $self is still there, just inside the array, to see this, add a print STDERR ... to your code, like this:
sub processJobs { my $self = shift; print STDERR "$self is <@$self>\n"; #print $self print "Processing Jobs for Server Named: ", $self->{name},"\n"; }
Best,beth
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Passing self to process as reference
by Anonymous Monk on Mar 18, 2009 at 11:26 UTC | |
by ELISHEVA (Prior) on Mar 18, 2009 at 11:58 UTC | |
by Anonymous Monk on Mar 18, 2009 at 11:48 UTC |