Alright, so I have managed to open the file I want, read it in, edit it, and then save it. However right now I have hard coded the line I want, which is a bad idea IMHO. The file I am reading in is a XML file, I know I know, use XML::Simple, well I was told not to, and I like my job more than I want to make a point. So I read the XML file it, but I want to check each line for a string, the problem is nigh. All of the XML elements are not read! Only the node contents, lets look at an example:
<house>
<room>Kitchen</room>
<room>Computers</room>
</house>
I only end up with Kitchen and Computers when I read in the lines like so:
open FILE, "<$file";
@lines = <FILE>;
close FILE;
The string I want to look for is in the attribute of an element, so you see my dilema, I can't see the elements, how can I search for my string? Any ideas whats going on here?
<house>
<room>Kitchen</room>
<room>Computers</room>
</house>
I only end up with Kitchen and Computers when I read in the lines like so:
open FILE, "<$file";
@lines = <FILE>;
close FILE;
The string I want to look for is in the attribute of an element, so you see my dilema, I can't see the elements, how can I search for my string? Any ideas whats going on here?