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

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
Buddha443556
Forum Regular
Posts: 873
Joined: Fri Mar 19, 2004 1:51 pm

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

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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?
User avatar
Buddha443556
Forum Regular
Posts: 873
Joined: Fri Mar 19, 2004 1:51 pm

Post 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.
Post Reply