#! /usr/bin/env perl local $/; # Slurp the whole file my $contents = ; $contents =~ m@^

NAME

@m; $contents = $'; # Everything before and including NAME is removed $contents =~ m@^@@g; # All paragraph tags are removed $contents =~ s@^\s+@@s; # All whitespace at the beginning is removed $contents =~ s@\s+$@@s; # All whitespace at the end is removed $contents =~ s@\s+@ @gs; # All whitespace blocks are collapsed to a space print $contents;