open (IN, "$output") or die "I couldn't get at $output"; my @Top_URLs = ; foreach my $URL (@Top_URLs) { my $final_page = get "$URL";#grab the link urls get $url my @Results =(); push @Results,$_ unless ($_ eq "\n"); for my $Results (@Results) { if ($Results =~ s/.*\///) { print OUT2 "$Results\n"; } } }