Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: Distinguish between HTML and Plain text

by Khen1950fx (Canon)
on Sep 27, 2011 at 02:24 UTC ( #928000=note: print w/ replies, xml ) Need Help??

in reply to Distinguish between HTML and Plain text

It can be done. Is it precise? You be the judge:

#!/usr/bin/perl -l use strict; use warnings; use Text::FromAny; my $log = '/root/Desktop/text.log'; open STDOUT, '>', $log; my $entries= "<TITLE>Page 7</TITLE>"; print $entries; my $tFromAny = Text::FromAny->new(file => $log); print $tFromAny->detectedType; close STDOUT;
Instead of thinking "can't", think "don't do that". It works, but it's not best practice.

Comment on Re: Distinguish between HTML and Plain text
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://928000]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2016-02-06 18:39 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (235 votes), past polls