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 / sign.al < prev    next >
Encoding:
Text File  |  2004-03-29  |  786 b   |  43 lines

  1. # NOTE: Derived from blib\lib\Mail/Internet.pm.
  2. # Changes made here will be lost when autosplit is run again.
  3. # See AutoSplit.pm.
  4. package Mail::Internet;
  5.  
  6. #line 491 "blib\lib\Mail/Internet.pm (autosplit into blib\lib\auto\Mail\Internet\sign.al)"
  7. sub sign
  8. {
  9.  my $me = shift;
  10.  my %arg = @_;
  11.  my $sig;
  12.  my @sig;
  13.  
  14.  if($sig = delete $arg{File})
  15.   {
  16.    local *SIG;
  17.  
  18.    if(open(SIG,$sig))
  19.     {
  20.      local $_;
  21.      while(<SIG>) { last unless /\A(--)?\s*\Z/; }
  22.  
  23.      @sig = ($_,<SIG>,"\n");
  24.  
  25.      close(SIG);
  26.     }
  27.   }
  28.  elsif($sig = delete $arg{Signature})
  29.   {
  30.    @sig = ref($sig) ? @$sig : split(/\n/, $sig);
  31.   }
  32.  
  33.  if(@sig)
  34.   {
  35.    $me->remove_sig;
  36.    map(s/\n?\Z/\n/,@sig);
  37.    push(@{$me->body}, "-- \n",@sig);
  38.   }
  39. }
  40.  
  41. # end of Mail::Internet::sign
  42. 1;
  43.