#!/usr/bin/perl
my @lines = <>;
my $text = join('', @lines);
my $title;
if($text =~ /^\*\* (.*?)\n/m){
$title = $1;
$text = $` . $';
}else{
$title = "Untitled";
}
$text =~ s/[ \t]+$//mg;
$text =~ s/^$/
/mg;
$text =~ s!\b([a-z0-9]+\.(c|s|pl|h))\b!$1!g;
$text =~ s!^(Lecture [0-9]+\. .*?)$!$1!mg;
$text =~ s!^\* (.*?)$!