Skip to content

Instantly share code, notes, and snippets.

@satomixx
Created March 25, 2013 09:37
Show Gist options
  • Save satomixx/5235998 to your computer and use it in GitHub Desktop.
Save satomixx/5235998 to your computer and use it in GitHub Desktop.
スゲい簡単なPerl入門 - 1stDay ref: http://qiita.com/items/ba7a1d337cfa586eb24d
$ perl test
Name "main::hoge" used only once: possible typo at test line 3.
$ perl test.pl
$bar is in hoge package
$bar is in hoo package
$bar is in main package
$ perl test.pl
$bar is in hoge package
$bar is in hoo package
$bar is in main package
#!/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