#!/usr/bin/perl -w # read split BABYL files, keep From line, write mbox to stdout. use strict; my $file; my $from; foreach $file (@ARGV) { open(F, "< $file") || die "$file: $!\n"; $from = 'From nobody@nowhere.org Fri Aug 26 16:56:36 2005'; while () { chomp; last if /\*\*\* EOOH \*\*\*/; if (/^Mail-from: (.*)/) { $from = $1; } } print "$from\n"; print while ; print "\n"; close(F); } exit(0);