#!/usr/bin/perl # @(#) newstree.pl v1.3 (7/20/96) # Written by Sarang Gupta (sarang@sarangworld.com) $mdl="Message-ID:";$rdl="References:";$sdl="Subject:";$ARGV[0]=~s/\./\//g; $grp="news/$ARGV[0]/*";for $m (glob($grp)){ open(A,$m);while(){ split;if ($_[0] eq "") {last}; if ($_[0] eq $mdl) {$mno{$_[1]}=$m;push(@top,$m);$ch{$m}=[]}; if ($_[0] eq $rdl) {$x=$ch{$mno{$_[-1]}};push(@$x,pop(@top))} if (shift(@_) eq $sdl) {$s{$m}=join(" ",@_)}} close(A)} print"Content-Type: text/html\n\n\n"; sub gay { print"
  • ".$s{$_[0]}."\n"; $x=$ch{$_[0]};for(@$x){print""}} # Please visit http://www.sarangworld.com/perlscript.php3 for a full list # of my Perl scripts, or http://www.sarangworld.com/ to see my website