# This file is encoded in Char::GB18030.
die "This file is not encoded in Char::GB18030.\n" if q{ } ne "\x82\xa0";
use strict;
# use warnings;
use Char::GB18030;
print "1..1\n";
my $__FILE__ = __FILE__;
my $chcp = '';
if ($^O =~ /\A (?: MSWin32 | NetWare | symbian | dos ) \z/oxms) {
$chcp = `chcp`;
}
if ($chcp !~ /932|936/oxms) {
print "ok - 1 # SKIP $^X $__FILE__\n";
exit;
}
mkdir('hoge', 0777);
open(FILE,'>hoge/eXg\[X.txt') || die "Can't open file: hoge/eXg\[X.txt\n";
print FILE "1\n";
close(FILE);
my($fileName) = glob("./hoge/*");
# if ($fileName =~ /\Q\[X\E/) {
if ($fileName =~ /\[X/) {
print "ok - 1 $^X $__FILE__\n";
}
else {
print "not ok - 1 $^X $__FILE__\n";
}
unlink('hoge/eXg\[X.txt');
rmdir('hoge');
__END__
½Æ¦ÎA./hogezºÉweXg\[X.txtxÆ¢¤t@Cª Á½ÆµÜ·B
w[xðÊ̶µ¢·é½ßÉAw\[Xxð\QÆ\EÅÍñÅÝÜ·B
»ÌQFR[hÍshiftjisAÍshiftjisAWüoÍÍshiftjis
ÀsÊ
C:\test>perl $0
Unmatch
./hoge/eXg\[X.txt
µ©µAãLÅÍ}b`µÜ¹ñB
Ⱥ©Æ¢¤ÆA /\Q\[X\E/ÍA\QæèæÉw\[Xx¶ñª]¿³êéÌÅA
î{IÉw[xðGXP[vµ½Éܹ߬ñB
8/2(y) ¡[Perlm[g] VtgJIS¿Ìt@C¼É}b`µÄÝé
http://d.hatena.ne.jp/chaichanPaPa/20080802/1217660826