in reply to how to parse output from isql utility

I would use DBI for this. Generally, using a seperate database program to get at the data is error prone (though I must admit I've done it myself a couple of times when I couldn't get the DBI modules installed fast enough).

This should get you started (UNTESTED):

use DBI; my $dbh = DBI->connect( @some_connect_info, { RaiseError => 1 } ); my ($count) = $dbh->fetchrow_array("COUNT * FROM table"); my $sth = $dbh->prepare("SELECT col1,col2 FROM table"); $sth->execute(); while (my $res = $sth->fetchrow_hashref) { # in this block # value1 == $res->{col1}; # value2 == $res->{col2}; }
update: note that I don't need the $count variable at all. It's just there because you specified it in your post. In perl, this is generally true; most looping constructs do not need a count. see also the perlsyn manpage