Page 1 of 1

A PHP question about Perl's HTML::CLEAN?

Posted: Wed Feb 22, 2006 1:29 pm
by Buddha443556
Since Google isn't being any help guess I'll ask here. :oops:

Anyone have any experience using HTML::Clean on PHP files? I'm concerned about weather it's safe on PHP files?

Done a little testing, besides saving me a kilobyte or more per request, I've found no new errors introduced. Seems to validate the same too.

This will be part of an automated process which is why I'm looking for any Gotchas.

Posted: Wed Feb 22, 2006 1:38 pm
by feyd
Although it's been a seriously long time since I used Perl, so I won't go down that road. But what about Tidy?

Posted: Wed Feb 22, 2006 3:18 pm
by Buddha443556
feyd wrote:Although it's been a seriously long time since I used Perl, so I won't go down that road. But what about Tidy?
HTML::Clean minimizes the HTML (stripping the whitespace and comments safely) though I think I could get Tidy to do that, it would be a lot more work.

I'm going to be using HTML::Clean in a perl script that syncs my development and production servers. I've been stripping the whitespace using "PHP -w" but that doesn't touch the HTML. Adding HTML::Clean will fix that problem. [... and I won't feel so guilty about all my pretty HTML anymore either. :D ]

Think I'll just have to have a look at HTML::Clean's PM to ease my nagging doubts. Wish CPAN had annotation like the PHP Manual.