use warnings; use strict; use Tk; if ($^O =~ /Win32/){ my $gof_wrapped = \&Tk::getOpenFile; *Tk::getOpenFile = sub{my $file = shift->$gof_wrapped; return Win32::GetANSIPathName($file)}; } my $mw = tkinit; my $path = $mw->getOpenFile(); open (my $fh, '<', $path) or die "can not open file $path : $!"; while (my $line = <$fh>) { print $line; } close $fh; MainLoop;