Skip to content

Conversation

@rjbs
Copy link
Contributor

@rjbs rjbs commented Mar 1, 2025

Some methods, most notably ->mkdir and ->mkpath and ->remove_tree, expected a single hash reference (or nothing) as an argument. If passed a string (for example), they would treat it like {}.

This hid this broken code:

path($root)->mkdir('name-of-child');

It would not create $root/name-of-child, but would ensure that $root existed, then return.

This code will notice extra or non-hashref arguments and raise an exception. An explicit undef is permitted, although only out of a sense of caution.

This fixes #300

Some methods, most notably ->mkdir and ->mkpath and ->remove_tree,
expected a single hash reference (or nothing) as an argument.  If passed
a string (for example), they would treat it like {}.

This hid this broken code:

    path($root)->mkdir('name-of-child');

It would not create $root/name-of-child, but would ensure that $root
existed, then return.

This code will notice extra or non-hashref arguments and raise an
exception.  An explicit undef is permitted, although only out of a sense
of caution.
@xdg xdg merged commit 07dc0ee into dagolden:master Mar 11, 2025
16 checks passed
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.

mkdir, mkpath, and remove_tree accept bogus arguments

2 participants