Skip to content

Instantly share code, notes, and snippets.

@bjjb
Created February 19, 2014 16:25
Show Gist options
  • Select an option

  • Save bjjb/9095572 to your computer and use it in GitHub Desktop.

Select an option

Save bjjb/9095572 to your computer and use it in GitHub Desktop.
#! /usr/bin/env perl
# Takes input like
# 1
# 2
# 3
# and outputs
# (1, 2, 3)
#
# Useful for converting a single column of SQL IDs to a list that you can use
# in a query.
while(<>) {
chomp;
print $. == 1 ? "(" : ", ";
print;
}
print(")");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment