in reply to Giving names to bits

You could trick Perl a bit by passing the status identifiers as if they were subroutine names. It looks cool yet requires that you turn off strict on subs:
#!/usr/bin/perl use warnings; use strict; no strict "subs"; my $Status=0; # holds bitwise status sub SetStatus{ my (@bits) = @_; my %StatusBits= ( PowerOn=>1, LightOn =>2, TurboOn=>4 ); $Status |= $StatusBits{$_} foreach (@bits); } SetStatus(PowerOn,TurboOn); print "status = $Status \n";