in reply to how to empty the built_in variable
You are not checking if the regex matched before you use the value of $1.
Changing the guts of your code to the following may give you the desired result.
Output:if( $line =~ /\s+<\w+\/?>(.*)<\/\w+>/ ) { $line = $1; print "$line\n"; } else { print "no match\n"; }
First_Table no match
Finally, why did you comment out use strict, and if you're parsing what appears to be XML or HTML, why not use a parser?
|
|---|