$end = 0; $var = 1; $code='print "test $code"; $end = 1 if ($var >= 2); $var++; eval ($code) if ($end == 0);'; eval($code);