#!/usr/bin/perl -w
# doc_munge
#   Grab everything between the BODY tags and add Mason <%text> tags.
# $Id: doc_munge,v 1.1 2003/05/13 19:20:08 max Exp $

local $/ = undef;

my $contents = <STDIN>;

$contents =~ s/^.*<BODY[^>]*>//is;
$contents =~ s!</BODY.*!!is;

$contents = '<%text>' . $contents . '</%text>';

print $contents;
