awk and split and variable used prior

I am trying to use awk and its split function to get the number of tokens in a string that are seperated by underscores.

ex_alex_is_testing_this_script_ex would return 7. It works when I directly put the string in. However, I can not get it to work when I try to refer to a variable used earlier in my Script. I think this is because of the BEGIN statement. Any ideas to get this to work with a variable that was used prior.

WORKING:
'BEGIN {print split("ex_alex_is_testing_this_script_ex", myarray, "_")}'
--> returns 7

NOT WORKING
'BEGIN {print split($something, myarray, "_")}' i.e --> I want to count how many underscores are in the $something.

Thanks for your help,

Alex
Montreal, Canada

echo "${something}" | nawk -F_ 'BEGIN {print NF}'
#or
nawk -v something=${something}" 'BEGIN {print split(something, foo, "_")}' < /dev/null
#or
nawk -v something=${something}" 'BEGIN {print gsub("_", "", something)}' < /dev/null
#or
echo "${something}" | sed 's/[^_]//g' | wc -c

thanks for you help. I'm using the second example.