#!/usr/bin/perl use warnings; use strict; use Tk; my $types = [['Format Perl', '.pl']]; my $mw = new MainWindow ( ) ; $mw->setPalette(background=>'black', foreground=>'white'); my @files; $mw -> Button ( -text => 'Select File ' , -command => \&open_it )-> pack(-padx=>5, -pady=>5) ; MainLoop ( ) ; sub open_it { my $names = $mw ->getOpenFile ( -initialdir => '.', -filetypes => $types, -multiple => 1) ; foreach my $file( @{$names} ){ print "Result ", $file, "\n" ; } }