in reply to Here document and sqlplus

Is there a way for me to check the output of the select statment inside the here document?

No. The here document is just a string. You have the semi-class problem of having a command that you want to both write to and read from. Take a look in perlipc in the online documentation (perldoc perlipc), and look for the section titled "Bidirectional Communication with Another Process". It'll describe how to use IPC::Open2.