You could either convert to integer:

$2nd=Val(split(@ipaddress0,'.')[1])

or use quotes in your case statements:

CASE
 $2nd='50'
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.