Link to home
Start Free TrialLog in
Avatar of shahrahulb
shahrahulb

asked on

error with www

use strict;
#use lib '/u/rshah1/toolswww/lib/site_perl/5.6.1/';
use lib '/u/rshah1/CPAN/mechanize/site_perl/5.6.1/';
use lib '/u/rshah1/CPAN/CPAN/5.6.1/';
use lib '/u/rshah1/CPAN/tagset/5.6.1/';
use lib '/u/rshah1/CPAN/Test/';
use lib '/u/rshah1/CPAN/parser/lib/';
use HTTP::Cookies;
use HTTP::Response;
use HTTP::Request::Common;
use LWP::UserAgent;
use Sys::Hostname;
use Time::Local;
use Crypt::SSLeay;
use WWW::Mechanize;
use HTML::TokeParser;
use Net::FTP;
#use Test::More qw(no_plan);;


my $mech = WWW::Mechanize->new();
$mech->agent_alias( 'Windows IE 6' );
#my $url = 'https://merchantaccount.quickbooks.com/j/mas/sasignup';
my $url = 'https://merchantaccount.quickbooks.com/j/mas/possignup';
$mech->get( $url );
print $mech->content();


when i run i get error:
500 /\x{FEFF}/: Can't use \x{} without 'use utf8' declaration

what does it mean??????

also i have all the necessary modules installed
Avatar of ozo
ozo
Flag of United States of America image

it means you have an old version of Perl that does not natively handle utf8
see
perldoc utf8
Avatar of shahrahulb
shahrahulb

ASKER

what shouldi do then
i checked the version, it is v5.6.0 built for sun4-solaris.  if i comment the line  print $mech->content();
the script does not give any error. but the $mech->content()  is very important in my script as i have to check the content

For your information,
when i run the above code on different server with "v5.6.1 built for sun4-solaris" it works fine

is it because of the version or something different????

what i should i do

Rahul
If you can't upgrade your Perl version, you might try
print $mech->{content};
Or try adding

use utf8;


use utf8;  does not works
what is the difference between print $mech->{content};  and print $mech->content()

i'll try that on monday once i reach office.

Rahul
can i try $mech->response()  or   $mech->res()
use utf8; didn't work
i tried $mech->title()    didn't throw any error but didn't display the title of the page too.

i tried use utf8; and $mech->{content}
not working

still getting error:
500 /\x{FEFF}/: Can't use \x{} without 'use utf8' declaration
is there any solution to my problem without upgrading the perl version
ASKER CERTIFIED SOLUTION
Avatar of PAQ_Man
PAQ_Man
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial