4492 Monks with min level 5 out of 72426 registrations Ratio: 0.0620219258277414 #### $/="# "; use strict; use warnings; use Data::Dump; sub split_fields ($){ map {s/:.*//; s/ \tbox.*//r;} split /\n/,$_[0]; } my @heads = split_fields(scalar ); my %data; my $sum; my $reg; my $min_level=5; while () { @data{@heads} = split_fields($_); if ($data{Level}>= $min_level) { # dd \%data; $sum += $data{Users}; } $reg += $data{Users}; # print "$_\n--------\n"; } print "$sum Monks with min level $min_level out of $reg registrations\n"; print "Ratio: ",$sum/$reg; __DATA__ Level: Users: MinXP: AvgXP: MaxXP: box height 3 # 0 582 -1.1e4 -31 -1 box height 301 # 1 58831 0 3 19 box height 27 # 2 5274 20 31 49 box height 11 # 3 2082 50 66 89 box height 6 # 4 1165 90 115 149 box height 5 # 5 910 150 193 249 box height 4 # 6 772 250 314 399 box height 3 # 7 524 400 486 599 box height 3 # 8 508 600 730 899 box height 3 # 9 393 901 1080 1299 box height 2 # 10 324 1300 1509 1796 box height 2 # 11 228 1800 2058 2393 box height 1 # 12 152 2400 2636 2999 box height 2 # 13 204 3004 3454 3989 box height 1 # 14 147 4002 4654 5392 box height 1 # 15 81 5455 6194 6981 box height 1 # 16 67 7001 7822 8960 box height 1 # 17 46 9040 10136 11899 box height 1 # 18 40 12163 13807 15758 box height 1 # 19 34 16135 18542 21838 box height 1 # 20 29 22671 26165 29596 box height 1 # 21 12 31284 35149 39430 box height 1 # 22 6 40728 42543 44300 box height 1 # 23 6 54780 56601 58425 box height 1 # 24 3 60407 64945 68793 box height 1 # 25 2 70186 70639 71092 box height 1 # 28 4 114023 349805 1007447