in reply to replace a value in an array

if ((uc($survn) eq uc($poolm)) && ($survwk = $weekin))
I think you want a numeric compare (==) , not an assignment (=)
if ((uc($survn) eq uc($poolm)) && ($survwk == $weekin))