Nov 15, 2014, 1:47 PM
Post #1 of 2
Help using Google::Voice module
my $g = Google::Voice->new->login('xxxxxx', 'xxxxxx');
# Send sms
$g->send_sms(5178810973 => 'Hello friend!');
# Error code from google on fail
print $@ if !$g->send_sms('invalid phone' => 'text message');
When I try to run this simple script to send a text message using google voice I get two error messages. The first:
Use of uninitialized value $_ in string at Mojo/Util.pm line 112.
I have no idea how to fix and I'm a little cautious about messing with this code which I don't know much about.
The second problem I get is:
Can't call method "send_sms" on an undefined value at sendtext.pl line 6.
After looking it up online it seems that it's an error which happens when the login into google fails, but I'm unsure what I'm doing wrong. I place my username and password in single quotes where they're supposed to go.