home *** CD-ROM | disk | FTP | other *** search
- From: subbarao@phoenix.Princeton.EDU (Kartik Subbarao)
- Newsgroups: comp.lang.perl,alt.sources
- Subject: perl version of from(1)
- Message-ID: <azioL/5ej/g.c@idunno.Princeton.EDU>
- Date: 19 May 91 23:54:24 GMT
-
- Anyone know of a cooler way to do this?
- ---------
-
- #! /usr/princeton/bin/perl
-
- open(mail, $ENV{'MAIL'}) || exit;
-
- while (<mail>) {
- if (/^From /) { # Note this is different from From:
- chop ($out = $_); print $out;
- while (<mail>) {
- if (/^$/) {
- print "\n";
- last;
- }
- if (/^Subject:/) {
- chop;
- @subj = split(/[: ]/,$_);
- print ' "'.$subj[2].'"'."\n";
- last;
- }
- }
- }
- }
- --
- internet% ypwhich
-
- subbarao@phoenix.Princeton.EDU -| Internet
- kartik@silvertone.Princeton.EDU (NeXT mail)
- SUBBARAO@PUCC.BITNET - Bitnet
-