Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rhansen
Copy link
Member

@rhansen rhansen commented Jul 29, 2024

Previously, nochg responses were treated as failures and the logged message for all responses was incorrect (either undef or "Unknown reply from Infomaniak").

Background: Hash values are always scalars, so lists of values can only be stored in hashes in arrayref form.

The following is legal but does not do what one might expect:

my %h = (
    a => (1, 2),
    b => (3, 4),
);

The => operator is just a variant of the comma operator, and lists in list context are flattened, so the above is equivalent to:

my %h = ('a', 1, 2, 'b', 3, 4);

which is equivalent to:

my %h = (
    a => 1,
    2 => 'b',
    3 => 4,
);

which is obviously not what was intended.

rhansen added 3 commits July 29, 2024 04:02
Previously, `nochg` responses were treated as failures and the logged
message for all responses was incorrect (either `undef` or "Unknown
reply from Infomaniak").

Background: Hash values are always scalars, so lists of values can
only be stored in hashes in arrayref form.

The following is legal but does not do what one might expect:

    my %h = (
        a => (1, 2),
        b => (3, 4),
    );

The `=>` operator is just a variant of the comma operator, and lists
in list context are flattened, so the above is equivalent to:

    my %h = ('a', 1, 2, 'b', 3, 4);

which is equivalent to:

    my %h = (
        a => 1,
        2 => 'b',
        3 => 4,
    );

which is obviously not what was intended.
@rhansen rhansen merged commit 32f9552 into ddclient:master Jul 29, 2024
@rhansen rhansen deleted the infomaniak branch July 29, 2024 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant