i am getting an error when my code is fine that is my database connectivity is fineeval { open($DBH, $dbh = DBI->connect('dbi:ODBC:driver=microsoft access driv +er (*.mdb);dbq=C:\main.mdb')) or die MyFileException->new("Unable to open file - $DBH"); }; if ($@) { # now $@ contains the exception object of type MyFileException # print "raman"; print $@->getErrorMessage(); # where getErrorMessage() is a method in MyFileException class }
Can't locate object method "getErrorMessage" via package "Can't locate object method "new" via package "MyFileException" (perhaps you forgot to load "MyFileException"?) at C:\Inetpub\wwwroot\amexpmo\login\amex\logprg2.cgi line 27. " (perhaps you forgot to load "Can't locate object method "new" via package "MyFileException" (perhaps you forgot to load "MyFileException"?) at C:\Inetpub\wwwroot\amexpmo\login\amex\logprg2.cgi line 27. "?) at C:\Inetpub\wwwroot\amexpmo\login\amex\logprg2.cgi line 34.
In reply to exception handling by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |