$file->command ( -label => 'Open', -accelerator => 'Ctrl-o', -underline => 0, -command => \&open_file); $mw->bind('', [\&open_file]); #SUPPORTED FILES TO OPEN my $types_OPEN = [ ['text files', '.txt'], ['All Files', '*'],]; sub open_file { my $open = $mw->getOpenFile(-filetypes => $types_OPEN, -defaultextension => '.txt'); print qq{You chose to open "$open"\n} if $open; my $open = $mw; }