in reply to How to take the last character out of a string
$query =~ s/,$//; [download]
Better, though, to not put it there:
my @cols = qw(foo bar baz); $query1 = 'select ' . join (',',@cols); [download]