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 ) { .... }
In reply to Re^5: Repeating a capture group pattern within a pattern
by Corion
in thread Repeating a capture group pattern within a pattern
by mldvx4
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |