#-------------Locate content and strip excess whitespace to make Satellink's server happy-------------#
($junk,$restofemail)=split(/Event reminder:/,$message);
($Event,$restofemail)=split(/Date:/,$restofemail);
($Date,$restofemail)=split(/Time:/,$restofemail);
($Time,$restofemail)=split(/Location:/,$restofemail);
$Location=$restofemail;
$Event =~ s/^\s+|\s+$//g;
$Date =~ s/^\s+|\s+$//g;
$Time =~ s/^\s+|\s+$//g;
$Location =~ s/^\s+|\s+$//g;
chomp $Event;
chomp $Date;
chomp $Time;
chomp $Location;
#-------------combine important parts-------------#
$message = join("\n",$Event,"Date: $Date","Time: $Time","Location: $Location\n");
&page;}
}
sub page{
#print 'Number: '.$number\n.' Message: '.$message;
$snpp = Net::SNPP->new('nois1.satellink.net');
$snpp->send(Pager => $number,
Message => $message,
) || die $snpp->message;
$snpp->quit;
}