Perl: Similar conditions in an if. How to make it shorter & nicer? -


this long:

 if (    $self->{status} == 1 ||          $self->{status} == 2 ||           $self->{status} == 3     ){                                                                                                                                                                                         $self->status(4);  } else {                         croak "only 1,2 , 3 change 4"; }      

how make nicer & shorter?

maybe smart match operator:

if ( $self->{status} ~~ [1,2,3] ) {