petepdx has asked for the wisdom of the Perl Monks concerning the following question:
Now for the fun part, in the script if I uncomment the lines
I get what I want, but why the need for appending a empty string to $result ?use encoding 'latin1'; $result .= "";
Or better asked, what should I be doing in the first
place ?
======================================================
======================================================#!/usr/local/bin/perl use warnings; use strict; $|++; use WWW::Mechanize; #use encoding 'latin1'; #use encoding 'ascii'; #use encoding 'UTF-8'; my $mech = WWW::Mechanize->new(); my $url = "http://www.undeerc.org/wind/winddb/top.asp?TableName=tblDee +rtrailCO"; $mech->get( $url ); print "1" x 70, "\n"; print "|", $mech->content, "|\n"; my $result = $mech->content(format => 'text'); $result =~ s/[\r\n]//g; print "2" x 70, "\n"; print "|$result|\n"; #$result .= ""; $result =~ s/\s+/ /g; print "3" x 70, "\n"; print "|$result|\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WWW::Mech / Unicode issue ?
by thundergnat (Deacon) on May 10, 2005 at 16:03 UTC |