#!/usr/bin/perl use strict; use warnings; my $start = 0; my $h2 = 0; my $keyword = ""; my $end = 0; while ( my $Content = ) { chomp( $Content ); my $content = lc( $Content ); if ( $start == 0 ) { $start = index ( $content, '
' ); } else { if ( $h2 == 0 ) { my $h = index ( $content, '

' ); if ( $h >= 0 ) { $h2++; $keyword = substr( $Content, $h+4 ); my $tmp = lc ( $keyword ); $end = index ( $tmp, '

' ); if ( $end >= 0 ) { $keyword = substr( $keyword, 0, $end ); print "$keyword\n\n"; $h2 = 0; $keyword = ""; } } } else { $end = index ( $content, '' ); if ( $end >= 0 ) { $keyword .= substr( $Content, 0, $end ); print "$keyword\n\n"; $h2 = 0; $keyword = ""; } else { $keyword .= $Content; } } } } __DATA__

Key words: Some words.

Date: 2012-01-16

Actualised: 2008-01-08

Commented: 05.06.2007

Encoded: Some code.

Problem

Problem description.

Another description.

Solution 1

Solution description.

Solution 2

Solution description.

Comment.

Text of the comment.