[Chicago-talk] WWW::Mechanize can't recognize a html file with no file extention.

James.Q.L shijialeee at yahoo.com
Sun Mar 5 21:22:21 PST 2006


hi, 

i am reading many html files locally using WWW::Mechanize and URI. 
the html files have no extention. however, WWW::Mechanize can't seem to recognize the file as
html.
the followign code spits out the html source file instead of text only.
a file with ht[m|ml] extention works fine. anyway i can get around it without renaming all the
files (not that it is a big deal though, but i am wondering..)

use strict;
use warnings;
use URI::file;
use WWW::Mechanize;

my $m = WWW::Mechanize->new();
$m->get(URI::file->new('/home/pub/html/test/151683_10')); 
print $m->content(format => 'text');

TIA,

Qiang

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Chicago-talk mailing list