tie my $state, 'Scalar::Restrict', qw/ idle waiting active /; # or maybe lock_scalar my $state, qw/ idle waiting active /; # $state may now only be "idle", "waiting", or "active"