in reply to Auto-filling an array

My approach has been to do some quick post-processing. For example, this chunk from a processor that uses Text::CSV_XS for reading and splitting each line: null values are usually undef, and I change them to the string '<NULL>' that an up-stream processor requires.
$line = $csv->getline($io); # .. some error-handling stuff. for (@$line) { $_ = '<NULL>' unless defined } #~ @$line = map { defined $_ ? $_ : '<NULL>' } @$line
Note that commented-out line: that works just as well. I haven't benchmarked it, so I don't know which is faster, but other maintainers were griping about the map{}, so I replaced it.

The basic logic (in both cases) is that I look for undefined values (you could also look for the empty string by substituting $_ eq '' for defined $_) and replace them with something.

This is, in general, better than prefilling: you need not alter this code if the length of your lines change.

Anima Legato
.oO all things connect through the motion of the mind