• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 162
  • Last Modified:

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
0
shahrahulb
Asked:
shahrahulb
  • 8
  • 3
1 Solution
 
ozoCommented:
it means you have an old version of Perl that does not natively handle utf8
see
perldoc utf8
0
 
shahrahulbAuthor Commented:
what shouldi do then
0
 
shahrahulbAuthor Commented:
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
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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

use utf8;


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

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

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

0
 
shahrahulbAuthor Commented:
i tried use utf8; and $mech->{content}
not working

still getting error:
500 /\x{FEFF}/: Can't use \x{} without 'use utf8' declaration
0
 
shahrahulbAuthor Commented:
is there any solution to my problem without upgrading the perl version
0
 
PAQ_ManCommented:
PAQed with points refunded (500)

PAQ_Man
Community Support Moderator
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 8
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now