18 lines
311 B
Perl
18 lines
311 B
Perl
#!/usr/bin/perl
|
|
|
|
# main 包
|
|
$i = 1;
|
|
print "包名 : " , __PACKAGE__ , " $i\n";
|
|
|
|
package Foo;
|
|
# Foo 包
|
|
$i = 10;
|
|
print "包名 : " , __PACKAGE__ , " $i\n";
|
|
|
|
package main;
|
|
# 重新指定 main 包
|
|
$i = 100;
|
|
print "包名 : " , __PACKAGE__ , " $i\n";
|
|
print "包名: " , __PACKAGE__ , " $Foo::i\n";
|
|
|
|
1; |