Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

MH Frequently Asked Questions (FAQ) with Answers
Section - babyl2mh.pl

( Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Schools ]


Top Document: MH Frequently Asked Questions (FAQ) with Answers
Previous Document: Switching xmh's editor
Next Document: inco - babyl to MH converter
See reader questions & answers on this topic! - Help others by sharing your knowledge
Date: Fri, 1 Mar 1991 13:03:15 -0800

#!/usr/gnu/bin/perl
# incorporate an RMAIL babyl file into an MH folder
#
# usage: babyl2mh +folder babyl-file
#
# V. Khera <khera at cs.duke.edu> 17-JUL-1991

# where to find rcvstore
$rcvstore = "/usr/local/lib/mh/rcvstore";

#
# pull out command line args
#
die "usage: babyl2mh +folder babyl-file\n" unless @ARGV == 2;

$folder = shift;
# make sure folder name starts with a "+"
(substr($folder,0,1) eq "+") || (substr($folder,0,0) = "+");
$bfname = shift;

print "Incorporating RMAIL file $bfname into MH folder $folder\n";

#
# read in babyl file.
#
$/ = "\037";	# this separates the records in a babyl file
$* = 1;		# records are multi-lines

open(BABYL,$bfname) || die "Couldn't open $bfname\n";

$_ = <BABYL>;	# discard header.

$msgnum = 0;

while (<BABYL>) {
  chop;		# get rid of delimeter
  s/\f(.|\n)*\*\*\* EOOH \*\*\*\n//;	# remove duplicate header information
  open(RCVSTORE,"|" . $rcvstore . " $folder");
  print RCVSTORE $_;
  $msgnum++;
  print "Message $msgnum done.\n";
}

User Contributions:

Comment about this article, ask questions, or add new information about this topic:

CAPTCHA




Top Document: MH Frequently Asked Questions (FAQ) with Answers
Previous Document: Switching xmh's editor
Next Document: inco - babyl to MH converter

Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
Bill Wohler <wohler@newt.com>





Last Update March 27 2014 @ 02:11 PM