while ($html =~ m{...}g) { my $new_url = $2; print "$new_url\n"; push @urls, $new_url; }