in reply to assigning regex matches to variables
Hope I haven't double-posted this... Problem solved -- thank you all VERY MUCH for your help. Having two errors at the same time made it hard to figure out. I didn't know that adding parentheses would force the statement to be evaluated in list context. I'm surprised that the distinction between list and scalar context isn't emphasized more in any of the regex documents I have read and I don't recall seeing the trick of forcing list context by using parentheses. However, it must be a common thing to want to change the value of a variable using a regex -- is there some other common syntax for that?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: assigning regex matches to variables
by jethro (Monsignor) on May 28, 2011 at 21:23 UTC |