I am trying to remove tag "INFO" and it's content from the file and print the remaining file but can't get result, I am not sure what going wrong please help!!
<COMPLETE> <T>test</T> <L>light</L> <INFO>information</INFO> </COMPLETE> <COMPLETE> <T>test</T> <L>light</L> <INFO>informa</INFO> </COMPLETE> Above xml is in file 'test.xml' open(OUT,"/home/test.xml"); while(<OUT>){ $line = $_; if($line =~ m#<INFO>(.+?)</INFO>#ig) { next; } print "$line\n"; }
When I run the above code I only get:
<COMPLETE> <T>test</T> <L>light</L> <INFO>information</INFO> </COMPLETE>
In reply to parsing xml by pinnacle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |