use ForkList; our $URLS; for $list(@LISTS) { $URLS = get_lines($list); run( \&callback, scalar(@$URLS), { kids => $KIDS, verbose => $VERBOSE } ); } sub callback { my ( $child, $i ) = @_; my $url = $URLS->[$i]; my( $code ) = cache_url( $url, $FORCE, $TIMEOUT ); append_file( "$LIST.$code", "$url\n", $child, $i, $VERBOSE ); return 0; }