script/perl-SMS-Send-Kannel-SMSbox-send_sms.pl untested

filter: Statementstmt 0.0% 0 / 26 Branchbran n/a Conditioncond 0.0% 0 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 5 Podpod n/a totaltotal 0.0% 0 / 37 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/local/bin/perl
2 use strict;
3 use warnings;
4 use Getopt::Std qw{getopts};
5 use DateTime;
6 use SMS::Send::Kannel::SMSbox;
7  
8 my $opt = {};
9 getopts("h:u:p:", $opt); #debug
10 my $host = $opt->{"h"}; #default undef from INI file
11 my $username = $opt->{"u"}; #default undef from INI file
12 my $password = $opt->{"p"}; #default undef from INI file
13 my $syntax = qq{$0 [-h host] [-u username] [-p password] phone "text"\n};
14 my $to = shift or die($syntax);
15 my $text = shift or die($syntax);
16  
17 my $service = SMS::Send::Kannel::SMSbox->new(host=>$host, username=>$username, password=>$password);
18  
19 my $status = $service->send_sms(
20 to => $to,
21 text => $text,
22 );
23 printf "%s: Phone: %s, Text: %s, Status: %s\n", DateTime->now, $to, $text, $status;
24  
25 __END__