in reply to Beginner Question on splitting.

Is your data in fixed-width columns? It looks like it might be, and unpack is the function of choice for that.

If it is tab delimited, instead, @split_array = split /\t/; will do the job.

If your data file is so messy that neither is true and you have only approximate gobs of whitespace, you can try to limit the amount of whitespace you split on with something like split /\s{1,8}/; (adjusted to fit).

Instead of slurping, why not do this line-by-line as you read the file?

my ($testnumber, $llimit, $value, $ulimit, $unit, $name) = 0..5; while (<INFILE>) { my @split_array = split /\t/; # or whatever printf 'TestNum = %s Value = %s Name = %s Ulimit = %s Llimit = %s.', @split_array[$testnumber, $value, $name, $ulimit, $llimit]; }
I changed the variables to hold their index in the record so they don't have to be reallocated all the time. The array slice uses those indexes to pick out the values for printf. If the numeric data gets used numerically before printing, you may want a fancier format string in printf.

Update: ++blokhead spotted a thinko, repaired.

After Compline,
Zaxo