Script to connect to PostgreSQL database

Hi All,

Has anyone of you connected to a remote PostgreSQL database through a shell/perl script. Can you please let me know the steps involed?

Thanks.

Rahul.