Qiang has asked for the wisdom of the Perl Monks concerning the following question:
the original one i used was like this and it works.
now that doesn't look efficient. so i try the following one. but it produces two arrays filled with the repeated items.@t1 = $resp->content=~/($cat_url_pattern\d+)/g; @t2 = $resp->content=~/$cat_url_pattern\d+','([^']+)'/g;
what is wrong with the 'while' one ?while ($resp->content=~/($cat_url_pattern\d+)','([^']+)'/g){ push @t1, $1; push @t2, $2; }
Edited by Chady -- removed html tags from code
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: backreference question.
by graff (Chancellor) on Jun 01, 2004 at 00:58 UTC | |
by Qiang (Friar) on Jun 01, 2004 at 01:58 UTC | |
by tilly (Archbishop) on Jun 01, 2004 at 07:24 UTC | |
by Jasper (Chaplain) on Jun 01, 2004 at 08:53 UTC | |
by tilly (Archbishop) on Jun 01, 2004 at 09:20 UTC | |
by Qiang (Friar) on Jun 01, 2004 at 17:45 UTC | |
|
Re: backreference question.
by Happy-the-monk (Canon) on Jun 01, 2004 at 00:30 UTC | |
by davidj (Priest) on Jun 01, 2004 at 00:39 UTC |