I'm going to take a wild guess and say that that script is not a shell script, right? What database are you using? That script actually looks like a session from a database client, like the MySQL client "mysql>", or the Oracle client "sqlplus>", or the PostgreSQL client "psql>". Are you sure you just want to know how to run that "script" from Perl?
Forget about Perl for the moment and using Perl to execute that "script" - how do you execute that "script" now?