Yes I have such files ... parsing XML is not as easy as it might seem, that's why there are the XML modules on CPAN. E.g. your program seems to have problems with nested tags like <ul><li><ul><li>1.1</li></ul></li></ul>.
So let me just make some general remarks to your program:
if ($read) { if ($more) { # do something } }
This assist you in locating possible errors.#!/usr/bin/perl -w #or use warnings;
foreach $line (@File_pre_format) { $file_pre_format .= $line; } # better: $file_pre_format = join '', @File_pre_format; $file_pre_format =~ s/\n//g; $file_pre_format =~ s/\t//g; # better: $file_pre_format =~ s/\n|\t//g; # or in this simple case even better: $file_pre_format =~ tr/\n\t//d;
-- Hofmator
In reply to Re: You have xml files where this formatting tool does not work?
by Hofmator
in thread You have xml files where this formatting tool does not work?
by LupoX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |