$html = get("http://www.iex.nl/Aandeel-Koers/11773/$aandeel/historische-koersen.aspx?maand=0") or die "could not get http://www.iex.nl/Aandeel-Koers/11773/@_/historische-koersen.aspx"; while ($html =~ /aug/g) { $count++ } print $count;