I prefer the following code:

my @f100 = sort @{$ifaces->{vmbr0}->{families}};
die "invalid families defined for vmbr0"
    if (scalar(@f100) != 2) || ($f100[0] ne 'inet') || ($f100[1] ne 'inet6');

> +# Compare two arrays of strings
> +sub strarray_equals($$) {
> +    my ($left, $right) = @_;
> +    return ref($left) && ref($right) &&
> +        ref($left) eq 'ARRAY' &&
> +        ref($right) eq 'ARRAY' &&
> +        scalar(@$left) == scalar(@$right) &&
> +        !grep { $left->[$_] ne $right->[$_] } (0..(@$left-1));
> +}
> +

_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to