|
I am using the following code to browse to a file in a directory.
#!/usr/bin/perl -w
use strict;
use Tk;
use Cwd;
my $top = new MainWindow;
my $selected_file;
print
"Filename: ",
$top->getOpenFile(-defaultextension => ".pl",
-filetypes =>
[['Excel files', '.xls' ],
['Text Files', ['.txt', '.text']],
['All Files', '*', ],
],
-initialdir => Cwd::cwd(),
-initialfile => "",
-title => "Ysdsdsad",
),
"\n";
print " Selected file is $selected_file\n";
How do I put the select file name into $selected_file?
Thanks |