"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "examples/SendMail.pm" between
swatch-3.2.3.tar.gz and swatchdog-3.2.4.tar.gz

About: Swatchdog (Simple WATCHdog) activly monitors log files produced by UNIX’s syslog facility (former name "Swatch").

SendMail.pm  (swatch-3.2.3):SendMail.pm  (swatchdog-3.2.4)
package Swatch::SendMail; package Swatchdog::SendMail;
require 5.000; require 5.000;
require Exporter; require Exporter;
use strict; use strict;
use Carp; use Carp;
use Mail::Sendmail; use Mail::Sendmail;
use Sys::Hostname; use Sys::Hostname;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
skipping to change at line 26 skipping to change at line 26
$VERSION = '20031118'; $VERSION = '20031118';
################################################################ ################################################################
sub send_mail { sub send_mail {
my $login = (getpwuid($<))[0]; my $login = (getpwuid($<))[0];
my $host = hostname; my $host = hostname;
my %opts = ( my %opts = (
'ADDRESSES' => $login, 'ADDRESSES' => $login,
'FROM' => "$login\@$host", 'FROM' => "$login\@$host",
'SUBJECT' => 'Message from Swatch', 'SUBJECT' => 'Message from Swatchdog',
@_ @_
); );
(my $to_line = $opts{'ADDRESSES'}) =~ s/:/,/g; (my $to_line = $opts{'ADDRESSES'}) =~ s/:/,/g;
my %mail = ( To => $to_line, my %mail = ( To => $to_line,
From => $opts{FROM},, From => $opts{FROM},,
Subject => $opts{SUBJECT}, Subject => $opts{SUBJECT},
Message => $opts{MESSAGE}, Message => $opts{MESSAGE},
); );
sendmail(%mail) or warn $Mail::Sendmail::error; sendmail(%mail) or warn $Mail::Sendmail::error;
return 0; return 0;
} }
################################################################ ################################################################
## The POD ### ## The POD ###
=head1 NAME =head1 NAME
Swatch::SendMail - Swatch interface to the Mail::Sendmail module Swatchdog::SendMail - Swatchdog interface to the Mail::Sendmail module
=head1 SYNOPSIS =head1 SYNOPSIS
use Swatch::SendMail; use Swatchdog::SendMail;
=head1 SWATCH SYNTAX =head1 SWATCH SYNTAX
=head1 DESCRIPTION =head1 DESCRIPTION
=head1 AUTHOR =head1 AUTHOR
E. Todd Atkins, todd.atkins@stanfordalumni.org E. Todd Atkins, todd.atkins@stanfordalumni.org
=head1 SEE ALSO =head1 SEE ALSO
perl(1), swatch(1). perl(1), swatchdog(1).
=cut =cut
1; 1;
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS