in reply to Re^4: Repeating a capture group pattern within a pattern
in thread Repeating a capture group pattern within a pattern

I would first split and then process in chunks of 21 items:

my @values = split /\s+/, $weatherdata; croak "Invalid item count in weather data" unless @values % 21 == 0; while(my @row = splice @values, 0, 21 ) { .... }