in reply to Open file & Strip comma delimiter

print OUT "$var1,"|",$var2,"|",$var3,"|", ... ^
Remove that first double-quote, or you'll end up bitwise OR'ing a bunch of strings together.