- Notifications
You must be signed in to change notification settings - Fork 603
Closed
Description
Description
According to perldoc -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 is eq "", 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 be is_bool.
Alternatively, the documentation should be changed to match the existing behavior.
(This is with v5.40.0.)
Metadata
Metadata
Assignees
Labels
No labels