sub _thread_sub_in_a_plugin { my $self = shift; my $plugins_ref = shift; my $thread_queue = shift; my $mw = shift; #$self->{'thread_queue'} = $thread_queue; $$plugins_ref{'imagePlugin'}->{'thread_queue'} = $thread_queue; # The 2 above same thing, really... while (1) { my ($full_path) = $thread_queue->dequeue; ... } }