|Think about Loose Coupling|
Assigning REGEX Match to a separate variable?by mmartin (Monk)
|on Apr 02, 2012 at 16:32 UTC||Need Help??|
mmartin has asked for the
wisdom of the Perl Monks concerning the following question:
I have what is probably a simple question for you all.
How can I set a separate variable to the output of a REGEX match...?
The line I'm looking at is part of an XML file, and looks something like this(below):
I've tried the following but I'm getting an integer as the new variable's data instead of the string:
FYI: the array "@reportData" holds all the file's lines...
While looping through the array it finds the correct line, so the "if statement" is working correctly. But I can't seem to get the value of the REGEX match within the "if statement" to be assigned to the variable $changeType...?
If anyone has any suggestion, please let me know.
Thanks in Advance,