use constant READ_PERM => READ_PERM use constant WRITE_PERM => WRITE_PERM; use constant EXECUTE_PERM => EXECUTE_PERM; my @allowed_perms = ( READ_PERM, EXECUTE_PERM ); # Check permissions if ( scalar(@allowed_perms) == 0 ) { print "PERMISSION DENIED\n"; exit -1; } if ( grep { $_ == READ_PERM } @allowed_perms ) print "READ Allowed\n"; if ( grep { $_ == WRITE_PERM } @allowed_perms ) print "WRITE Allowed\n"; if ( grep { $_ == EXECUTE_PERM } @allowed_perms ) print "EXECUTE Allowed\n";