perl version of from(1)

Kartik Subbarao subbarao at phoenix.Princeton.EDU
Mon May 20 09:54:24 AEST 1991


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 at phoenix.Princeton.EDU -| Internet
kartik at silvertone.Princeton.EDU (NeXT mail)  
SUBBARAO at PUCC.BITNET			          - Bitnet



More information about the Alt.sources mailing list