Created
August 30, 2023 16:01
-
-
Save eam/ebb1b46d7cd44b158a29c82cc99ca91b to your computer and use it in GitHub Desktop.
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 -w | |
use warnings; | |
use strict; | |
use feature 'say'; | |
use utf8; | |
use open qw( :std :encoding(UTF-8) ); | |
use lib "."; | |
use 中文; | |
say "hi"; | |
package foo; | |
#包 你好; | |
print "here is 包 and foobar\n"; | |
sub foo { 1 }; | |
#函数 bar { 2 }; | |
1; |
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
$ ./test.pl | |
hi | |
here is 包 and baz |
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
use utf8; | |
package 中文; | |
use Filter::Simple; | |
FILTER { | |
s/函数/sub/g; | |
s/包/package/g; | |
s/foobar/baz/g | |
}; | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment