Posted on 2009-08-25 05:33:06-07 by newperler
Getting file name
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
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.