in reply to Re^2: wanting to make a file of strings usable by SQL
in thread wanting to make a file of strings usable by SQL

I am thinking that reading the whole file into an array might turn out to be the simplest way to do this after all.

Well, if your input files are not huge and you don't make this into a (bad) habit, that should be fine:

my @lines=map {chomp; "'$_'"} <>; $"=",\n"; print "(@lines)\n";

Mind you: it can be done in less obscure ways, and it is certainly not the best one. Just wanted to show it to add one entry to the TMTOWTDI bag...

PS: even more obscurely:

$"=",\n"; print "(@{[map {chomp; qq|'$_'|} <>]})\n";