Add 'no bareword::filehandles' #199

Open
wants to merge 1 commit into from

2 participants

@doherty

This disallows the use of bareword filehandles:

    open IN, '<', $file; #dies with:
        # Can't use string ("IN") as a symbol ref while "strict refs" in use

Partially fixes #175. no multidimensional causes t/autovivification.t to fail with "Can't use an undefined value as a HASH reference at t/autovivification.t line 10." and I'm not sure why.

@doherty doherty Add 'no bareword::filehandles'
This disallows the use of bareword filehandles:

    open IN, '<', $file; #dies with:
        # Can't use string ("IN") as a symbol ref while "strict refs" in use

Partially fixes #175
ee51aaf
@schwern

Looks good. I'll add a bit more testing to make sure it doesn't leak out of its scope. Also to make sure it doesn't effect STD* and friends.

@doherty

My understanding is that the STDs and friends are explicitly permitted. This makes them more like magical globals rather than bareword filehandles, which is useful from a pedagogical point of view, I think.

@schwern

Sorry for leaving this hanging for so long. My main concern is that it would break existing code and thus require a 2 -> 3 change. This isn't a problem, but I want to queue those changes up.

@doherty

Yes, I assumed that's why it wasn't being merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment