Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

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.

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 drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2016-09-30 11:05 GMT
Find Nodes?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:

    Results (563 votes). Check out past polls.