in reply to Multiple file selection in Tk dialogbox

You try something like this ...

#!/usr/bin/perl -w use strict; use Tk; use Tk qw(exit); use Tk::DialogBox; my $FILE1 = "Please select a file"; my $FILE2 = "Please select a file"; my $top = MainWindow->new(); my $thebutton = $top->Button( -relief => "groove", -text => "Click Me ", -command => \&thebuttonCallback)->pack(); sub selectFile1Callback { my $userSelectedFile = $top->getOpenFile( -defaultextension => ".ctl", -filetypes => [ ['Control Files', '.ctl'], ['All Files', '*'] ], -initialdir => "C:\\TEMP", -initialfile => "Junk.txt", -title => "Select file 1" ); if ($userSelectedFile) { $FILE1 = $userSelectedFile; } } sub selectFile2Callback { my $userSelectedFile = $top->getOpenFile( -defaultextension => ".ctl", -filetypes => [ ['Control Files', '.ctl'], ['All Files', '*'] ], -initialdir => "C:\\TEMP", -initialfile => "Junk.txt", -title => "Select file 2" ); if ($userSelectedFile) { $FILE2 = $userSelectedFile; } }

There is a lot of room for improvement.
You only need one selectFileCalback.
Hope that helps

--
Its like a dog that can sing and dance.
It's remarkable because it can do it.
Not that it can do it well.