I just learned poo and i got to play with perl, achieved this but I do not get the expected output, problem with mysql? Or bad code?. other thing, the same query runs on console
The OO itself is correct.
The error message comes from MySQL, denying access for the user 'delkav', but I the user you want to connect with is 'root'.
Anyway, seems your DBI->connect() line is wrong. To follow the DBD::mysql docs, you must change your line:
my $connect = DBI->connect("DBI:mysql:$database:$host", $user, $pwd) or die $DBI::errstr;
to
my $connect = DBI->connect("DBI:mysql:database=$database;host=$hostname;", $user, $pwd) or die $DBI::errstr;