I tried to send this to the pdk listserv but it wasn't accepted.
Has anyone else run into this? Is there a solution?
I just introduced a use of the Switch module into our Classified Ad Extractors. A snippet of the code used is shown below. The complete extractor runs in the Komodo Debugger just as it should. The case statements perform just as they should.
But when I attempt to build a PerlApp of the extractor, I get the error below. I had an extractor where the switch code below was commented out, but the use Switch; was still in. It resulted in the error when I attempted to compile. If I comment out the "use Switch;", it will compile.
I thought it was because of the SQL CASE statements I have in my Main Database Query but that does not appear to be the case.
I would really like to use code of the form below in my extractors because it is much cleaner than a elsif structure where I would need to compare $docClass with the beginning and end of a class range.
Does anyone have any ideas how I could solve this compile time problem.
Thanks,
Dale
----
Dale L. Puckett
Director of Operations, Midwest Division
Brainworks Software Development Corporation
7570 West 21st Street North, Building 1010C
Wichita, KS 67205
631-963-5555
dpuckett@brainworks.com
----------
Bad switch statement (problem in the code block?) near c2w-MASTER.pl line 0
'c2w-MASTER.pl' had compilation errors.
----------
use Switch;
switch( $docClass )
{
case 1 { $majorCategory = "LEGALS"; };
case 2 { $majorCategory = "SPECIALS"; }
case 6 { $majorCategory = "MEMORIAM"; }
case [8..16] { $majorCategory = "ANNOUNCE"; }
case 4100 { $majorCategory = "ANNOUNCE"; }
case [21..32] { $majorCategory = "EMPLOY"; $ad_typeCG="Employment"; }
case [4200..4250] { $majorCategory = "EMPLOY"; $ad_typeCG="Employment"; }
}
etc.