Perl command line interpreter has stopped working

Posted by navin_ids on 2018-03-07 22:46


Iam new to Perl programming, and just started grasping the concept of a scripting language. here is my problem i am using the win32::ODBC Perl Package to read a table data from sql database. but when the code reaches a specific line the perl crashes with the popup saying "Perl command line interpreter has stopped working". and the same set of code is used in many other places to retrieve data from db successfully.

Error log from Event Viewer

Faulting application name: perl.exe, version:, time stamp: 0x599f96cf
Faulting module name: ODBC.dll, version:, time stamp: 0x5695c3fb
Exception code: 0xc0000005
Fault offset: 0x00005fe4
Faulting process id: 0x1eb0
Faulting application start time: 0x01d3b696652180ac
Faulting application path: C:\Perl\bin\perl.exe
Faulting module path: C:\Perl\site\lib\auto\Win32\ODBC\ODBC.dll
Report Id: c2d2b0f3-2289-11e8-973e-001cc066b2c9

Below is the sample code

$sqlcal = "SELECT COUNT(*) AS cnt FROM Table WHERE (Param1= '$p1') AND (Param2= '$p2')";
if ($dbmst->Sql($sqlcal)){
print "SQL failed.\n";
print "$sqlcal\n";
print "Error: " . $dbmst->Error() . "\n";
# Error is thrown in the line below.
%Datamst = $dbmst->DataHash();

$xchk = $Datamst{"cnt"};

i cant figure out what i am doing wrong. please help me out guys

Iam using windows8,perl version

With Regards

perl error.PNG12.66 KB

ActiveState Staff
Thu, 2018-03-08 10:55

You're getting a Windows illegal request error with a threaded Perl and a module which the maintainer considers highly likely to be thread-unsafe.

Modern Perls should be used with the DBI/DBD database drivers.

Also, watch out that you are not mixing bitnesses. On a 64-bit Windows, you could have both 32-bit and 64-bit ODBC DSNs available. Use the one which matches the Perl.