Project status: project created DB update: database initialized Project status: world domintation ahead DB update: database low on memory DB update: database borks ; all data lost Project status: shattered dreams Project status: starting all over again #### #!/usr/bin/perl my %cats; my $cat = "_UNDEFINED:"; open my $fh, '<', 'categories.txt' or die; while (<$fh>) { next if m/^\s*$/; #skip blank lines if (m/^(.+:)\s*$/) { $cat = $1; next; } $cats{$cat} .= ">> $_"; } for (sort keys %cats) { print "$_\n"; print $cats{$_}; } close $fh; #### DB update: >> database initialized >> database low on memory >> database borks ; all data lost Project status: >> project created >> world domintation ahead >> shattered dreams >> starting all over again