File::Tail will let you grab just the last part of the file. Post up a snippet of the XML, and what you are trying to do, and maybe someone could help you, if you can't figure it out from here. | [reply] |
Check out LMX. It's a reverse XML parser. It parses an XML file in reverse, and it seems like what you are looking for.
AFIAK, there isn't a perl interface. And it requires MacOS. The author says that the next version will be cross-platform, however. | [reply] |
Hi,
Please read How (Not) To Ask A Question, especially the part about posting the code that you already tried yourself.
Regards,
svenXY | [reply] |
Hi.
Sorry, there was no try on my part, it was just begginers question if there is a command telling perl to start reading from the end of the file (and to my surprise googling didnt help). The answers below are appreciated (unfortunately i dont have mac). I found yet another package File::ReadBackwards and whe trying I bumped into a surprising problem: when I read xml file it is broken into individual letters instead of lines. And when I tried standard procedure
open(DATAFILE, $file);
while (defined ($line = <DATAFILE>)) {
chomp $line;
print $line
}
close(DATAFILE);
and got the same letter soup. What is wrong? I tried to redefine end of line by setting local $/ as "something at the beggining of the file" and something not in the file but it doesnt helped (and did similar in File::ReadBackwards->new( $filename_in,"something as above" ))). Please help.
| [reply] [d/l] |