while ( %count < 5 ) {
%b = $v1

$v1 stores the left part of the last if comparison, in this case %count.