3 # Check that utf8.pm and its dependencies only use the subset of the
4 # $1..$n capture vars that Perl_save_re_context() is hard-coded to
5 # localise, because that function has no efficient way of determining at
6 # runtime what vars to localise.
8 # Note that this script tests for the existence of symbol table entries in
9 # %::, so @4 etc would trigger a failure as well as $4.
11 # If tests start to fail, either (in order of descending preference):
13 # * fix utf8.pm or its dependencies so that any recent change no longer
14 # uses more special vars (ideally it would use no vars);
16 # * fix Perl_save_re_context() so that it localises more vars, then
17 # update this test script with the new relaxed var list.
23 # trigger the dependency loading
27 # determine which relevant vars those dependencies accessed
30 grep !/^[0123]$/, # $0, and $1, ..$3 allowed
31 grep /^(?:\d+|[`'&])$/, # numeric and $`, $&, $' vars
34 # load any other modules *after* calculating @vars
40 is(scalar @vars, 0, "extraneous vars")
41 or diag("extra vars seen: " . join(", ", map "*$_", @vars));