![使用 perl 和 google voice 发送短信](https://linux22.com/image/1405604/%E4%BD%BF%E7%94%A8%20perl%20%E5%92%8C%20google%20voice%20%E5%8F%91%E9%80%81%E7%9F%AD%E4%BF%A1.png)
我尝试使用 perl 和 google voice 向我的手机发送短信。
我已经使用 perl 安装了 google::voice 模块:
perl -MCPAN -e "install Google::Voice"
perl 脚本:
use Google::Voice;
my $g = Google::Voice->new->login('my_account', 'my_password');
#send the text!
$g->send_sms('phone_number' => 'message to send'); #line 4
我收到这个错误
Can't call method "send_sms" on an undefined value at sms.pl line 4.
答案1
来自文档:
login
Login. Returns object on success, false on failure.
看起来登录失败了。询问之前请不要忽略错误检查。