#now send each line of the $isqlcommandfile to isql foreach my $line () { #usleep(4000); chomp $line; $exp->send("$line\n"); $exp->expect(2000, '-re', '\d+\> ') if (! $line=~m/^\s*exit\s*$/i); } $exp->soft_close();