Perl Oracle connection error

I've a Centralized Server which can connect to all Oracle Databases.

When I was trying the below code it doesn't work, But tnsping was working fine.

#!D:/perl5/bin/perl.exe

use DBI;

my $dbh = DBI->connect('dbi:Oracle:QBDIWCE', 'IDUSER', 'SECRET123#' ) || die( $DBI::errstr . "\n" ) ;

my $sth = $dbh->prepare( "SELECT username FROM dba_users;" );

$sth->execute( );

exit;

Error as follows

D:\SharedData\EDM>perl Oracle_connect_test.pl
DBI connect('QBDIWCE','IDUSER',...) failed: ORA-12154: TNS:could not resolve the connect identifier specified
(DBD ERROR: OCIServerAttach) at Oracle_connect_test.pl line 14

when I searched in Google it felt that the above Connect is to connect only to the DB which is n the same server. So my question what is the code to connect to all other DB from a Centralized server.

Thanks
Gopal

Try with:

"dbi:Oracle:host=<dbhost>;sid=<oracle_sid>;port=<port>" ..

Or just define an alias in your tnsnames.ora.