in reply to How may I set a bit or change (10100101 to 10100111)?

You can mask and work on bits in a manner similar to C. That is, to set a bit OR your number with a number that has the bit set. Use | for or, & and, etc.:
my $bit_set = $old_number | 0x2;
All of those are borrowed from C notation. If your ints are too big look at Math::BigInt, which I think is standard, but I could be wrong.

Phil