If you want to use grep results in bash scripts then it can get confusing. Because if grep returns a result then its exit status is 0; if it does not return anything the exit status is 1.
So these two line mean, if my script my_clever_script.pl is currently not running.
ps ax | grep my_clever_script.pl | grep -v grep
if [ $? -eq 1 ]; then