|
NAMENet::SNPP - Simple Network Pager Protocol Client SYNOPSIS use Net::SNPP;
# Constructors
$snpp = Net::SNPP->new('snpphost');
$snpp = Net::SNPP->new('snpphost', Timeout => 60);
NOTEThis module is in a maintenance mode, as I no longer have significant access to SNPP servers to test with. However, to the best of the present maintainer's knowledge, the module works just fine and has been used in many a production environment. DESCRIPTIONThis module implements a client interface to the SNPP protocol, enabling a perl5 application to talk to SNPP servers. This documentation assumes that you are familiar with the SNPP protocol described in RFC1861. A new Net::SNPP object must be created with the new method. Once this has been done, all SNPP commands are accessed through this object. EXAMPLESThis example will send a pager message in one hour saying "Your lunch is ready" #!/usr/local/bin/perl -w
use Net::SNPP;
$snpp = Net::SNPP->new('snpphost');
$snpp->send( Pager => $some_pager_number,
Message => "Your lunch is ready",
Alert => 1,
Hold => time + 3600, # lunch ready in 1 hour :-)
) || die $snpp->message;
$snpp->quit;
CONSTRUCTOR
METHODSUnless otherwise stated all methods return either a true or false value, with true meaning that the operation was a success. When a method states that it returns a value, failure will be returned as undef or an empty list.
2WAY EXAMPLES use Net::SNPP;
my $snpp = Net::SNPP->new( "snpp.provider.com" );
$snpp->two_way();
$snpp->pager_id( 5555555555 );
$snpp->data( "The sky is falling!\nThe sky is falling!" );
$snpp->message_response( 1, "Don't Panic" );
$snpp->message_response( 2, "Panic!" );
my @result = $snpp->send_two_way();
$snpp->quit();
printf "Use these two numbers: \"%s %s\" to check message status.\n",
$result[0], $result[1];
__END__
use Net::SNPP;
my $snpp = Net::SNPP->new( "snpp.provider.com" );
my @status = $snpp->message_status( $ARGV[0], $ARGV[1] );
$snpp->quit;
printf "User responded with: %s\n", $status[3];
EXPORTS"Net::SNPP" exports all that "Net::CMD" exports, plus three more subroutines that can bu used to compare against the result of "status". These are :- "CMD_2WAYERROR", "CMD_2WAYOK", and "CMD_2WAYQUEUED". SEE ALSONet::Cmd RFC1861 AUTHORDerek J. Balling <dredd@megacity.org> ( original version by Graham Barr ) Al Tobey <tobeya@tobert.org> (since Oct 2003) COPYRIGHTCopyright (c) 1995-2001 Graham Barr. (c) 2001-2003 Derek J. Balling. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. $Id: SNPP.pm,v 1.9 2004/01/27 22:18:32 tobeya Exp $
|