sub get_colinfo { my $table = shift; open TINFO, "-|", "echo \"info columns for $table\" | iSQL 2>&1" or die "foo $?"; my @colinfo = (); while () { if (/^SQL/) { # oops, got an error print STDERR $_; while () { print STDERR $_; } last; } my @info = split(/\|/, $_); my $colname = $info[1]; my $ntype = $info[2]; my $collen = $info[3]; $colinfo[0] = $colname; $colinfo[1] = $ntype; $colinfo[2] = $collen; } return \@colinfo; }