# CODE: Start #!perl -w use strict; my $pasteRaw; while() { # Remove spaces from before ':' to avoid splitting on 'hair colour'. substr($_, 0, 1+index($_, ":")) =~ tr/ //d; $pasteRaw .= $_; } my @pasteSplitAll = split( "[^:] |\n", $pasteRaw ); # [1] See below # Remove empty parts of the array. my @pasteNotEmpty = grep { $_ ne "" } @pasteSplitAll; # Defined an index for splicing later. my $index = 0; # Set the index (looking for 'Number') $pasteNotEmpty[$_] =~ /^Number/ and $index = $_ and last for 0..$#pasteNotEmpty; my @pasteUseful = splice( @pasteNotEmpty, $index-2, 70 ); $pasteUseful[$_] =~ s/^\w+:// for 0..$#pasteUseful; # CODE: End