in reply to Html - dynamic array

Another note,
my $rws = 0; for (...) { $foo[$rws] = ...; $rws++; }
is a weird/convoluted way of doing
for (...) { push @foo, ...; }

You have two instances of unnecessarily using a counter.