home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-perl-addon-1.4.9-installer.exe / testfile.pm < prev    next >
Encoding:
Perl POD Document  |  2004-03-10  |  877 b   |  43 lines

  1.  
  2. package Mail::Mailer::testfile;
  3. use vars qw(@ISA $VERSION %config);
  4. require Mail::Mailer::rfc822;
  5. @ISA = qw(Mail::Mailer::rfc822);
  6. $VERSION = '0.02';
  7.  
  8. %config = ( outfile=>'mailer.testfile', );
  9.  
  10. sub can_cc { 0 }
  11.  
  12. my $num = 0;
  13.  
  14. sub exec {
  15.     my($self, $exe, $args, $to) = @_;
  16.     open F,'>>', $Mail::Mailer::testfile::config{outfile};
  17.     print F "\n===\ntest ", ++$num, " ",
  18.             (scalar localtime), "\nto: " . join(' ',@{$to}) . "\n\n";
  19.     close F;
  20.     untie(*$self) if tied *$self;
  21.     tie *$self, 'Mail::Mailer::testfile::pipe', $self;
  22.     $self;
  23. }
  24.  
  25. sub close { 1 }
  26.  
  27. package Mail::Mailer::testfile::pipe;
  28.  
  29. sub TIEHANDLE {
  30.     my $pkg = shift;
  31.     my $self = shift;
  32.     return bless \$self;
  33. }
  34.  
  35. sub PRINT {
  36.     my $self = shift;
  37.     open F, '>>', $Mail::Mailer::testfile::config{outfile};
  38.     print F @_;
  39.     close F;
  40. }
  41.  
  42. 1;
  43.