use Net::SNPP; # Constructors $snpp = Net::SNPP->new('snpphost'); $snpp = Net::SNPP->new('snpphost', Timeout => 60);
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.
#!/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;
If HOST is not given, then the SNPP_Host specified in Net::Config will be used.
OPTIONS are passed in a hash like fashion, using key and value pairs. Possible options are:
Timeout - Maximum time, in seconds, to wait for a response from the SNPP server (default: 120)
Debug - Enable debugging information
Example:
$snpp = Net::SNPP->new('snpphost', Debug => 1, );