Like the previous PHP Strip_tags() javascript equivalent question, I am looking for PHP strip_tags() Perl equivalent? I have to stip all html tags from content in Perl.
Like the previous PHP Strip_tags() javascript equivalent question, I am looking for PHP strip_tags() Perl equivalent? I have to stip all html tags from content in Perl.
Use Perl's CPAN Strip module as indicated below:
HTML::Strip - Perl extension for stripping HTML markup from text.
CPAN strip module has the limitation that despite only outputting one space character per group of tags, and avoiding doing so when tags are bordered by spaces or the start or end of strings, HTML::Strip can often output more than desired; such as with the following HTML:
This gives the following output:
Thus, you may want to post-filter the output of HTML::Strip to remove excess whitespace (for example, using tr/ / /s;). (This has been improved since previous releases, but is still an issue)
Post Comment