http://www.perlmonks.org?node_id=924837


in reply to issue in isql connection

I have been using Sybase recently so here goes.

Firstly, as others have said, if you can then use DBI, with DBD::Sybase. It provides a much nicer interface than attempting to parse the output from isql. However you may find (like me) that your are not allowed to install any non core modules for various reasons. (In my case the code was intended to run on a locked down server, where all code needs to pass a detailed security audit.

If you must use isql, then it wants spaces between the argument and the value. The code I used was like this:

open ISQL, '|-', "isql -D $database -U $username > $tmpFile 2>&1" or d +ie; print ISQL $passwod."\n"; print ISQL "select * from $table where $query\n"; print ISQL "go\n"; print ISQL "quit\n"; close ISQL; # Now read the output from $tmpFile