mschout / perl-text-template

Expand template text with embedded Perl
13 stars 6 forks source link

added strict option to fill_in #3

Closed nawglan closed 6 years ago

nawglan commented 6 years ago

cpan-prc Dec, 2017 assignment.

only works when HASH is also passed as an option to fill_in.

adds use strict; use vars (...); to the beginning of the prepend section

only the keys of the HASH option are allowed to be variables in the template.

updated documentation, added tests.

mschout commented 6 years ago

Looks good. I'm seeing Travis failures for perl < 5.20. Its possible that it has nothing to do with this PR. I'm going to get that fixed first (or at least figure out why its failing) before merging.

Thanks!

mschout commented 6 years ago

The issue here is that the warning changed in 5.22, so the test looking for the string

did you forget to declare "my \$foo"

fails for perl < 5.22.

If you instead look for

Global symbol "\$foo" requires explicit package

Then the tests pass.

I checked with all versions from 5.14 to 5.24.

I'll merge this and fix the test case.