#!/usr/bin/perl
my $name = lcfirst shift
or die "Usage: $0 clause-name\n";
@ARGV = ();
while (<>) {
if ( $. == 1 ) {
s/\t/, /g;
print "% ", lc;
next;
}
chomp;
s/'/''/g;
s{
# Find a place that is preceded by the beginning of the string or a tab
(?:
(?<=\t)
|
(?<=^)
)
# Only non-numbers are to be escaped.
(?!-?(?:\d+(?:\.\d+)?|0?\.\d+)(?:\t|$))
# Capture everything up to the next delimiter or end of string.
([^\t]*)
}
{'$1'}gx;
tr/\t/,/;
print "$name($_).\n";
}
perlmonks.org content © perlmonks.org and diotalevi, Ovid
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03