open(TMP, ">/tmp/t$$.sql") || die "can't open temp file: $!"; # Set nocount to avoid the "xxx rows affected" message in isql print TMP "set nocount on\ngo\nselect * from the_table\ngo\n"; close(TMP); # Note: -b flag suppresses column headers. open(ISQL, "isql -Ujoe -Pjoespwd -Smyserver -s'%%^^%%' -w 1024 -b -i /tmp/t$$.sql") || die "Can't run isql: $!"; while() { chomp; my @row = split(/%%^^%%/, $_); .... do something with the @row of data.... } close(ISQL);