Skip to content

[doc] join with undef values #22205

Open
Open
@hexcoder-

Description

@hexcoder-

Where

https://perldoc.perl.org/blead/functions/join as of 05/10/2024.

Description

join EXPR,LIST

  1. The documentation does not state how the return value is being built, when LIST contains 'undef' values.

F.e.:
my $rec = join(':', undef, undef);
does return ':' (with warnings).

What is missing in the documentation is that LIST items are stringified so that undefined values will be transformed to empty strings yielding the result of two empty string LIST items.

(In my first reading I overlooked the statement that join ALWAYS returns a string. So I assumed a single LIST item of undef would result in an undef value).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions