while ($resp->content=~/($cat_url_pattern\d+)','([^']+)'/g){ push @t1, $1; push @t2, $2; }