#!/usr/bin/perl use warnings; use strict; use Tk; my $mw = MainWindow->new; $mw->Button(-text => 'Select File', -command => \&org_select )->pack; MainLoop; sub org_select { my $filetypes = [ ['Drawing Files', '.drg'], ['All files', '*'] ]; my $select_file_full = $mw->getOpenFile( -filetypes => $filetypes); }