thanks for the mention. The article goes to lengths in describing the underlying encoding issues and how to deal with them,but for the OP's purpose the following code snippet extracted from the article should do it
use Win32::Console;
Win32::Console::OutputCP( 65001 );
use Devel::Peek;
use Win32::OLE qw(in);
binmode(STDOUT, ":utf8");
Win32::OLE->Option(CP =>
Win32::OLE::CP_UTF8);
$obj = Win32::OLE->
new('Scripting.FileSystemObject');
$folder = $obj->GetFolder(".");
$collection= $folder->{Files};
foreach $value (in $collection) {
$filename= %$value->{Name};
next if ($filename !~ /.rar/i);
print $filename,"\n";
Dump $filename,"\n";
}
I haven't benchmarked it but logically the Win32 API calls should be faster than calling into the COM,but nevertheless COM exposes FileSystemObjects methods which might be convenient anyway