foreach (split /,/, $perm) { warn "Invalid permission setting: $_" unless /^[ugoa]+=[rwxsS]+$/; }