Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/perl5Public

chdir doesn't return a boolean, but manual says it returns true/false #22365

Closed
@mauke

Description

@mauke

Description

According toperldoc -f chdir:

It returns true on success, false otherwise.

However,chdir actually returns (integer) 1 and 0. This is mostly observable in the failure case, which (according to the documentation) should return a value that iseq "", but isn't.

Steps to Reproduce

$ perl -wE 'say chdir "/invalid*"'0$ perl -Mexperimental=builtin -wE 'say builtin::is_bool chdir "/invalid*"'$

Expected behavior

$ perl -wE 'say chdir "/invalid*"'$ perl -Mexperimental=builtin -wE 'say builtin::is_bool chdir "/invalid*"'1$

I.e. a false value should stringify to the empty string and beis_bool.

Alternatively, the documentation should be changed to match the existing behavior.

(This is with v5.40.0.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp