Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#3 Win32 Perl API crashes if data file missing

open
nobody
None
5
2003-07-17
2003-07-17
Anonymous
No

I am running ActiveState Perl 5.8 on Windows XP. I
have installed the GeoIP.pm version 1.15 from
http://theoryx5.uwinnipeg.ca/ppms/Geo-IP.ppd. As part
of the installation this downloads the GeoIP.dat file
and places it in "c:/program files/GeoIP". A small test
script is run and succesfully finds the country from an IP.

I then delete the GeoIP.dat file and re-run the script.
Perl crashes with a Windows error (not a perl error
printed in the command line, but a windows dialogue box
saying "Perl Command Line Interpreter has encountered a
problem and needs too close.").

If I put back the GeoIP.dat the script works perfectly.

I can work around this by testing for the presence of
the file before running a GeoIP lookup, but I think the
GeoIP.pm should exit in a more graceful fashion if it
meets these conditions.

Thanks.

Discussion