Created
March 25, 2013 09:37
-
-
Save satomixx/5235998 to your computer and use it in GitHub Desktop.
スゲい簡単なPerl入門 - 1stDay ref: http://qiita.com/items/ba7a1d337cfa586eb24d
This file contains 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
$ perl test | |
Name "main::hoge" used only once: possible typo at test line 3. |
This file contains 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
$ perl test.pl | |
$bar is in hoge package | |
$bar is in hoo package | |
$bar is in main package |
This file contains 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
$ perl test.pl | |
$bar is in hoge package | |
$bar is in hoo package | |
$bar is in main package |
This file contains 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
#!/usr/bin/perl | |
package main; | |
$main::bar = '$bar is in main package'; | |
{ | |
package hoge; | |
$hoge::bar = '$bar is in hoge package'; | |
print $hoge::bar,"\n"; | |
} | |
{ | |
package hoo; | |
$hoo::bar = '$bar is in hoo package'; | |
print $hoo::bar,"\n"; | |
} | |
print $main::bar; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment