Bareword "a" not allowed while "strict subs" in use at sortHashForInsert line 5. Bareword "b" not allowed while "strict subs" in use at sortHashForInsert line 5. Bareword "c" not allowed while "strict subs" in use at sortHashForInsert line 5. Bareword "d" not allowed while "strict subs" in use at sortHashForInsert line 5. Bareword "e" not allowed while "strict subs" in use at sortHashForInsert line 5. Bareword "l" not allowed while "strict subs" in use at sortHashForInsert line 6. Bareword "p" not allowed while "strict subs" in use at sortHashForInsert line 6. #### use strict; my %hash = ( one => [qw(1 2 3 4 5)], two => [qw(a b c d e)], the => [qw(l m n o p)] ); my (@cols, @vals); foreach my $key ( keys %hash ) { push @cols, $key; push @vals, scalar( join ",", @{$hash{$key}} ); } foreach my $val ( @vals ) { print "$val"; print "\n"; } print "\n"; my $statement = 'insert into this (' . (join ",", @cols) . ') values (' . (join ",", @vals) . ')'; print "$statement\n\n";