home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 June / SIMTEL_0692.cdr / msdos / perl / digest.pl < prev    next >
Encoding:
Perl Script  |  1991-01-18  |  1.4 KB  |  42 lines

  1. #! /usr/bin/perl
  2. #
  3. #    This is 'digest' a program to run elm on a digest as a folder.
  4. #    Copyright (C) 1990  David J. Camp
  5. #
  6. #    This program is free software; you can redistribute it and/or modify
  7. #    it under the terms of the GNU General Public License as published by
  8. #    the Free Software Foundation; either version 1, or (at your option)
  9. #    any later version.
  10. #
  11. #    This program is distributed in the hope that it will be useful,
  12. #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. #    GNU General Public License for more details.
  15. #
  16. #    You should have received a copy of the GNU General Public License
  17. #    along with this program; if not, write to the Free Software
  18. #    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. #
  20. # david@wubios.wustl.edu             ^     Mr. David J. Camp
  21. # david%wubios@wugate.wustl.edu    < *   +1 314 382 0584
  22. # ...!uunet!wugate!wubios!david      v     "God loves material things."
  23. #
  24. $| = 1;
  25. open (FOLDER, ">/tmp/dig$$");
  26. while (<>)
  27.     {
  28.     if (/^------(\n|-----------------------(\n|-(\n|----------------------------------------\n)))/)
  29.         {
  30.         print FOLDER "From dummy Wed Feb  29 12:12:12 1990\n";
  31.         do
  32.             {
  33.             $_ = <>;
  34.             }
  35.             until (eof() || /[\041-\177]/);
  36.         }
  37.     print FOLDER $_;
  38.     }
  39. close (FOLDER);
  40. exec ("elm -f /tmp/dig$$ <&2 ; /bin/rm -f /tmp/dig$$");
  41.  
  42.