...
use if ($^O =~ m/MSWin32/i || ''), 'Win32';
...
my $is_win32 = $^O =~ m/MSWIN32/i;
...
sub test_file
{
my $file = ucx(shift);
...
}
sub ucx
{
my $fn = shift;
return $is_win32 ? Win32::GetANSIPathName($fn) : decode('utf8', $fn)
+;
}
Out of curiosity, I went looking for the GetANSIPathName method in the ActiveState (win32) lib code. As far as I could see, it's not a Perl function, so I guess it must be all in a dll someplace.
For anyone who wants to play with this, a zip of the code and data can be downloaded from http://itee.uq.edu.au/~chernich/downloads/tkbug.zip.
|