my $sender = $CGI->param("sender"); my $phone = $CGI->param("phonenumber"); # so am entering this way +12344, +123344, +45454444 in textarea my $message = $CGI->param("message"); my $rep = ''; if ($sender) { my @raw_params = split /\s+/, $phone; my @quoted_params = map { qq{"$_"} } @raw_params; my $quoted_params_string = join ", ", @quoted_params; my @recipients = ($quoted_params_string); foreach my $recipient (@recipients) { my $req = HTTP::Request->new(POST => 'https://api.twilio.com/2010-04-01/Accounts/AC5b68......756/Messages.json'); $req->content_type('application/x-www-form-urlencoded'); $req->authorization_basic("AC5b686.....56", "cd3.......d"); $req->content("To=$recipient&From=$sender&Body=$message"); my $response = $ua->request($req); if ($response->is_success) { $rep = "
Messages Sent
"; } else { $rep = "Nothing Sent
"; } } }