print "\tProcessing data...\n"; foreach my $link (@links) { # Get data from the internet my $httpReply = $browser->get($link); ####### This is the solution: piecewise matching, as suggested. while($html =~ m/(value)(value2)/g) { ## This is also my (a) solution, it turns out pushing two ## variables joined by a string is _way_ less expensive than ## an array, or anonymous array. ## ##The array has more things to keep track of than a simple scalar. # Correct? ## (I kinda went "doh!" when realized this...) push(@{$data{$2}}, join("::", $1, $link) ); } }