|
|
| "be consistent" | |
| PerlMonks |
Re: How to store matched $1 values one by one to array?by johngg (Abbot) |
| on Feb 02, 2013 at 13:40 UTC ( #1016713=note: print w/ replies, xml ) | Need Help?? |
|
Note that another, perhaps safer, way of capturing everything after "agent_id=>" up to but not including a comma is to use use a negated character class ([^,]+) meaning one or more of anything that isn't a comma rather than a non-greedy match of anything (.+?). You can also populate your array, let's call it @agents, in one fell swoop by using a global match (g flag) and a map within which we substitute away the double-quotes.
I hope this is helpful. Cheers, JohnGG
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||