6 use Config qw<%Config>;
8 use Test::More tests => 4;
10 sub Str::TYPEDSCALAR {
11 my $buf = (caller(0))[2];
12 open $_[1], '<', \$buf;
21 is $r, __LINE__-2, 'trick for our - readline';
25 is $s, __LINE__-2, 'trick for my - readline';
28 is $z, 7, 'trick for others';
33 sub Int::TYPEDSCALAR { push @lines, (caller(0))[2]; () }
36 use Lexical::Types as => sub {
37 # In 5.10, this closure is compiled before hints are enabled, so no hintseval
38 # op is added at compile time to propagate the hints inside the eval.
39 # That's why we need to re-use Lexical::Types explicitely.
40 eval 'use Lexical::Types; my Int $x';
45 is_deeply \@lines, [ 1, __LINE__-1 ], 'hooking inside the \'as\' callback';