# This file is encoded in ShiftJIS.
die "This file is not encoded in ShiftJIS.\n" if q{ } ne "\x82\xa0";
use strict;
# use warnings;
use Char::Sjis;
print "1..1\n";
my $__FILE__ = __FILE__;
if ($^O eq 'MacOS') {
print "ok - 1 # SKIP $^X $0\n";
exit;
}
my $chcp = '';
if ($^O =~ /\A (?: MSWin32 | NetWare | symbian | dos ) \z/oxms) {
$chcp = `chcp`;
}
if ($chcp !~ /932/oxms) {
print "ok - 1 # SKIP $^X $0\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 =~ /\[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
»ÌPFR[hÍshiftjisAÍshiftjisAWüoÍÍshiftjis
ÀsÊ
C:\test>perl $0
Unmatched [ in regex; marked by <-- HERE in m/[ <-- HERE X/ at $0 line 6.
µ©µAãLÅÍ}b`µÜ¹ñB
Æ¢¤©A³K\»G[ÉÈèÜ·B
±êÍAw\[XxÌw[xÌæQoCgªw[xÌR[hÉÈÁÄ¢é©çÅ·B
»µÄA¶Ìw]xªÈ¢½ßɳK\»G[ÉÈéÌÅ·B
8/2(y) ¡[Perlm[g] VtgJIS¿Ìt@C¼É}b`µÄÝé
http://d.hatena.ne.jp/chaichanPaPa/20080802/1217660826