There's more than one way to do things | |
PerlMonks |
Re^3: Using pattern matchby tceng (Novice) |
on Aug 10, 2007 at 18:30 UTC ( [id://631864]=note: print w/replies, xml ) | Need Help?? |
Thank you for your contribute! Unfortunately the idea was to be able to process regular expressions with more than one matching patter and be able to print out something that involves those matching patterns. I think it would help if Perl generates a list whose elements are all the matching patterns in a s/// operation. Ie that list contains $1, $2, $3, and so on, and a foreach can be done on it, so that one can pick up all the defined variables in one go and then substitute them with the method I showed before (s/\$1/$1/g). Is there one such list, please? Cheers, tceng
In Section
Seekers of Perl Wisdom
|
|