tokuhirom (owner)

Revisions

gist: 173328 Download_button fork
public
Public Clone URL: git://gist.github.com/173328.git
Embed All Files: show embed
hoge.pl #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use strict;
use warnings;
use PadWalker qw/peek_my/;
use Test::More;
use Data::Dumper;
 
sub foo {
    ${peek_my(1)->{'$x'}} = 'yay';
}
 
{
    my $x;
    foo();
    is $x, 'yay';
}
 
{
    foo(my $x);
    is $x, 'yay';
}
 
done_testing;