Can't locate object method "attrs" via package "Mojo::DOM"

873 views Asked by At

I'm having issues with using the Google Voice API to send a text message. I'm running Mac OS X Maveriks and it was working on the previous version (Mountain Lion). I got the Google Voice API installed but now I get this strange message.

Can't locate object method "attrs" via package "Mojo::DOM" at /Library/Perl/5.16/Google/Voice.pm line 39.

I am not sure what to do with this. I used CPAN to install Google::Voice which seemed to work.

3

There are 3 answers

1
Brian Wisti On BEST ANSWER

Judging by https://github.com/tempire/perl-google-voice, I think you are missing the Mojolicious prerequisite. I don't know how Perl is set up on your machine, so I will just point out that http://mojolicio.us/ provides installation instructions.

0
Oleg G On

It seems your Mojolicious version is too new. Mojo::DOM::attrs was removed since 4.50: see Mojolicious Cahnges. Now the method name is Mojo::DOM::attr.

You can decrease your Mojolicious version or just fill bug report for Google::Voice

0
Russ On

This is actually a pretty easy fix. There are two lines in the Google::Voice.pm where you need to change the method 'attrs' to 'attr'

as in

 $self->rnr_se($el->attrs->{value});

to .

 $self->rnr_se($el->attr->{value});

Change and save and you should be good to go.

I am using Strawberry Perl on an Windows 7 box, and modified Google::Voice version 0.06