my %SEARCH_FIELDS = ( '1.X' => [qw!RESULT_T LOTID DEVICEID SETUPID STEPID OMARK DIEPITCH WAFERID SLOTID CENTER DEFECTS!], '1.8' => [qw!LOTID WAFERID RESULT_T CENTER SLOTID DEFECTS DEVICEID DIEPITCH OMARK SETUPID STEPID!], ); #### my %KLARF_REGEXP = ( '1.X' => { 'LOTID' => qr/LotID "(.+)";/i, 'DEVICEID' => qr/DeviceID "(\w+)";/i, 'STEPID' => qr/StepID "(.+)";/i, 'SLOTID' => qr/Slot (\d+);/i, 'DEFECTS' => qr/DefectList/i, 'RESULT_T' => qr/ResultTimestamp (.+);/i, 'WAFERID' => qr/WaferID "(.+)";/i, 'SETUPID' => qr/SetupID (.+);/i, 'OMARK' => qr/OrientationMarkLocation (.+);/i, 'DIEPITCH' => qr/DiePitch (.+);/i, 'CENTER' => qr/SampleCenterLocation (.+);/i, }, '1.8' => { 'LOTID' => qr/LotRecord "(.+)"/i, 'DEVICEID' => qr/DeviceID 1 \{"(\w+)"\}/i, 'STEPID' => qr/StepID 1 \{"(.+)"\}/i, 'SLOTID' => qr/Field SlotNumber 1 \{(\d+)\}/i, 'DEFECTS' => qr/DefectList/i, 'WAFERID' => qr/WaferRecord "(.+)"/i, 'RESULT_T' => qr/Field ResultTimestamp \d \{(.+)\}/i, 'SETUPID' => qr/Field RecipeID 3 \{(.+)\}/i, 'OMARK' => qr/Field OrientationMarkLocation 1 \{(.+)\}/i, 'DIEPITCH' => qr/Field DiePitch \d \{(.+)\}/i, 'CENTER' => qr/Field SampleCenterLocation \d \{(.+)\}/i, }, ); #### while ( ){ if ( $_ =~ $KLARF_REGEXP{$KLARF_VERSION}{$current_state} ){ $summary->{$current_state} = $1 if $1; LogMsg( "Found $current_state $summary->{$current_state}" ) if $summary->{$current_state}; $current_state = shift @{$SEARCH_FIELDS{$KLARF_VERSION}}; } }