in reply to Creating a whitelist

You can also use an hash to hold the list and then check on the hash key, ie.
my %hash; @hash{ @orgs } = (1) x @orgs; error_suspect_org() unless defined $hash{ $organization };
See Slices doc for the hash slice.

Replies are listed 'Best First'.
Re^2: Creating a whitelist
by choroba (Cardinal) on Jun 16, 2016 at 14:18 UTC
    Using defined here is not needed. If you are sure you set the values to ones, just check the value is true, or just create the keys with no values, and check existence:
    # Truth @hash{@orgs} = (1) x @orgs; error_suspect_org() unless $hash{$organization}; # Existence undef @hash{@orgs}; error_suspect_org() unless exists $hash{$organization};

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,