Re: Tidy piping in perl

Dave wrote:
| Sorry, I regret to say that I am not a Perl hacker and am unable
| to diagnose the problem.

Hi, i read (after someone in news:de.comp.lang.perl gave me the hint)
the perldoc and it says

--snip--
   If the file handle came from a piped open `close()' will
   additionally return FALSE if one of the other system
   calls involved fails or if the program exits with non-
   zero status. (If the only problem was that the program
   exited non-zero `$!' will be set to `0'.) Also, closing
   a pipe waits for the process executing on the pipe to
   complete, in case you want to look at the output of the
   pipe afterwards. Closing a pipe explicitly also puts the
   exit status value of the command into `$?'.
--snip--

So replacing the old close command with something like

--snip--
if (close(TIDY) == 0) {
  my $exitcode = $? >> 8;
  if ($exitcode == 1) {
    printf STDERR "tidy issued warning messages\n";
  } elsif ($exitcode == 2) {
    printf STDERR "tidy issued error messages\n";
  } else {
    die "tidy exited with code: $exitcode\n";
  }
} else {
  printf STDERR "tidy detected no errors\n";
}
--snip--

Works fine.

Other suggestions did not :( but thanks anyway for trying to help.

The basic idea was to have any webinterface for private use
on my computer to clean up Html Code.

The IE5 supports an option to add tools to the PopUp menu that can e.g. open a
new window and load a specific  Url. I mad up a tool, that implements  Jigsaw
and the Validator  to check the Page just by two simple clicks. Another one
should be Tidy.

Another idea is to implement any Clean up option for the W3C Html Validator
using tidy.

Ok, enough about that.

Another question: I read, that entitys in a <head>er are not converted back to
e.g. "ö" or whatever by Searchengines and alike. The content of a meta tag is
CDATA and so entitys are allowed. iirc Tidy converts those characters to
entitys. Thats, if i'm right about the Searchengines, not very useful, maybe
an option to turn off the modification of header fields may be useful.

Another thing is the specified Charset. Iirc when i use the correct Charset it
becomes optional to use 'ö' or '&ouml;' so this replacement isn't necessary
(if i'm right, and tidy does this replacement)


The last thing is the use of this mailing list. Is it correct to reply to the
author and put a CC: to html-tidy@w3.org

regards and thanks for all, who tried to help,

 Bjoern
--
# Mein Platz im Netz : http://home.pages.de/~bjoernsworld/
# HTML Writers Guild : http://www.hwg.org

Received on Tuesday, 25 May 1999 10:04:10 UTC