sub listParse { my( $url, $Qout ) = @_; ## Get the first page my $content = get $url; ## find the links and push them onto the queue while( $content =~ m[...]g ) { $Qout->enqueue( $_ ); ### Links added to queue here. } ## Push 1 undef per thread to terminate their loops $Qout->enqueue( (undef) x $noOfThreads ); }