in reply to matching constants within a regular expression?
$var = "foo @{[ sub() ]} baz"; # Note: This calls the sub in list context, so may have a # different effect than if called in scalar context. Use # ${ \sub() } for scalar context.
Also, the /e modifier is for the s/// operator, not the m// operator, hence the syntax errors you are getting.
So you would want something like:
print "attribute 0=\t$1\n" if m/@{[ATTRIBUTE_0]}='(.*)'/;
It looks kind of ugly, but it works.
|
|---|