Subject: | unknown method host_port |
I'm using this code to attempt to access Google Calendar:
my $auth = Net::OAuth2::Profile::WebServer->new(
name => 'Google Calendar',
client_id => $foo,
client_secret => $bar,
scope => 'https://www.googleapis.com/auth/calendar.readonly',
);
Now, it's true that I may need extra options, Google is a quagmire of security through obscurity, but I am surprised that I get this error. Something is clearly up because URI does have a method host_port.
Can't locate object method "host_port" via package "URI::_generic" at
/Users/hornenj/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Net/OAuth2/Profile.pm line 197 (#1)
(F) You called a method correctly, and it correctly indicated a package
functioning as a class, but that package doesn't define that particular
method, nor does any of its base classes. See perlobj.
Uncaught exception from user code:
Can't locate object method "host_port" via package "URI::_generic" at /Users/hornenj/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Net/OAuth2/Profile.pm line 197.
at /Users/hornenj/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Net/OAuth2/Profile.pm line 197.
Net::OAuth2::Profile::build_request(Net::OAuth2::Profile::WebServer=HASH(0x7f9e7300b318), "POST", URI::_generic=SCALAR(0x7f9e73197178), HASH(0x7f9e74029590)) called at /Users/hornenj/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Net/OAuth2/Profile/WebServer.pm line 159
Net::OAuth2::Profile::WebServer::build_request(Net::OAuth2::Profile::WebServer=HASH(0x7f9e7300b318), "POST", URI::_generic=SCALAR(0x7f9e73197178), HASH(0x7f9e74029590)) called at /Users/hornenj/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Net/OAuth2/Profile/WebServer.pm line 83
Net::OAuth2::Profile::WebServer::get_access_token(Net::OAuth2::Profile::WebServer=HASH(0x7f9e7300b318), "gcal") called at ./gcal line 25