in reply to How can I set a bit to 0 ?

Set:

$flags |= 1 << $bit_num;

Clear:

$flags &= ~( 1 << $bit_num );

Toggle:

$flags ^= 1 << $bit_num;

Read (returns a true value or a false value):

$flags & ( 1 << $bit_num )

It looks like you have constants that are already of the form 1 << $bit_num, so

$stats &= ~downLoading; # No longer downloading.