use strict; use warnings; our (@table_min_1, @table_min_2, @table_max_1, @table_max_2, $array_name); while () { chomp; if (/Array\s+(\w+)\s+(\d+)/) { $array_name = 'table_' . $1 . '_' . $2; } else { no strict 'refs'; my @fields = split /\s+/; push @$array_name, $fields[1]; } } print "\n"; print "$_ " for @table_max_1, @table_max_2, @table_min_1, @table_min_2; print "\n"; __DATA__ ... #### use strict; use warnings; my (@table_min_1, @table_min_2, @table_max_1, @table_max_2, $array_name); while () { chomp; if (/Array\s+(\w+)\s+(\d+)/) { $array_name = '@table_' . $1 . '_' . $2; # ^ } else { my @fields = split /\s+/; eval qq(push $array_name, "$fields[1]"); } } print "\n"; print "$_ " for @table_max_1, @table_max_2, @table_min_1, @table_min_2; print "\n"; __DATA__ ... #### 15:43 >perl 1283_SoPW.pl a b c 1 2 3 d e f 4 5 6 15:43 >