Last active
December 23, 2015 02:49
-
-
Save fuba/6569554 to your computer and use it in GitHub Desktop.
なるほど…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[puma:~] ec% cat test.pl | |
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Data::Dumper::Names; | |
use PadWalker qw(var_name); | |
sub hoge1 { | |
warn '1'; | |
print Dumper @_; | |
warn var_name(1, \$_[0]); | |
} | |
sub hogehoge { | |
my $valiable = "string"; | |
hoge1($valiable, \$valiable); | |
hoge2($valiable, \$valiable); | |
} | |
hogehoge(); | |
my $valiable2 = "string2"; | |
hoge1($valiable2, \$valiable2); | |
hoge2($valiable2, \$valiable2); | |
sub hoge2 { | |
warn '2'; | |
print Dumper @_; | |
warn var_name(1, \$_[0]); | |
} | |
[puma:~] ec% carton exec perl ./test.pl | |
1 at ./test.pl line 8. | |
$VAR1 = 'string'; | |
$VAR2 = \$VAR1; | |
$valiable at ./test.pl line 10. | |
2 at ./test.pl line 25. | |
$VAR1 = 'string'; | |
$VAR2 = \$VAR1; | |
$valiable at ./test.pl line 27. | |
1 at ./test.pl line 8. | |
$VAR1 = 'string2'; | |
$VAR2 = \$VAR1; | |
$valiable2 at ./test.pl line 10. | |
2 at ./test.pl line 25. | |
$valiable2 = 'string2'; | |
$valiable2 = \$valiable2; | |
$valiable2 at ./test.pl line 27. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment