Skip to content

Conversation

@djerius
Copy link

@djerius djerius commented Apr 13, 2025

No description provided.

djerius added 3 commits April 13, 2025 15:46
e.g.

     1	use strict;
     2	use warnings;
     3	use autodie;
     4
     5	package Foo {
     6	    use File::Temp;
     7	    my ($fh, $file)  = File::Temp::tempfile;
     8	    mkdir $file;
     9	}
    10
    11	package Bar {
    12	    use autodie;
    13	    use File::Temp;
    14	    my ($fh, $file) = File::Temp::tempfile;
    15	    mkdir $file;
    16	}
    17

will not result in an exceptoin at line 8, but wil lat line 15.
@djerius
Copy link
Author

djerius commented Apr 13, 2025

Note! Behavior change: switching autodie on in Dist::Zilla::Tester::_Role found a bug: the rmdir of $self->tempdir_root in DEMOLISH was returning an error, as the directory was not empty. This caused that directory to be left after the tests were completed.

The new code now uses Dist::Zilla::Path->remove_tree to clean up the path, so there's a behavior change: the tmp directory is no longer left. Not sure if this is important.

@haarg
Copy link
Contributor

haarg commented Apr 17, 2025

The subject isn't really correct.

If autodie was entirely lexically scoped, it would not be necessary to use it in each package. It's actually both lexically and package scoped. It exports subs to the calling package, but also sets a lexical flag to enable them.

@djerius
Copy link
Author

djerius commented Apr 17, 2025

The subject isn't really correct.

If autodie was entirely lexically scoped, it would not be necessary to use it in each package. It's actually both lexically and package scoped. It exports subs to the calling package, but also sets a lexical flag to enable them.

Ok, how about "packages which depend upon autodie must use it."?

@rjbs rjbs force-pushed the main branch 2 times, most recently from 40e530a to 370397c Compare November 7, 2025 14:08
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.

2 participants