Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don’t trigger warnings for qq"@Builtin"
Built-in arrays should not be giving warnings about possible unin- tended interpolation (which happens with nonexistent arrays). Some built-in variables do not exist if they are not needed, but perl will generally pretend that they did already exist whenever they are fetched. It is such variables that trigger this warning erroneously: $ ./miniperl -we 'sub dump_isa { warn "@isa" } @isa = ("foo","bar"); dump_isa' Possible unintended interpolation of @isa in string at -e line 1. foo bar at -e line 1. I discovered this when writing a test for @db::args, using -w. warnings.pm uses @db::args, so ‘use warnings’ code won’t get the warn- ing, but code using -w gets it: $ ./miniperl -we 'sub foo { package DB { () = caller 0 } print "@db::args\n" } foo(1..3);' Possible unintended interpolation of @db::args in string at -e line 1. 1 2 3 The code in toke.c that decides whether this warning should take place needs to supply the GV_ADDMG flag to gv_fetchpvn_flags, making it one of the code paths that engages in the pretence mentioned above. That code already had an explicit exception for @+ and @-. This com- mit removes it as being no longer necessary.
- Loading branch information