Well, in what way does it "not work"?
Here's a minimal version that works in the sense that when you first click "Open" and select a file, and then click "Get Statistics", the latter routine prints the selected file name to the console. And if it can print the file name, it should also be able to do something else with it.
#!/usr/bin/perl -w use strict; use Tk; my $open; # declare global variable, my $mw = MainWindow->new(); $mw-> Button( -text =>'Open', -command => \&open_file )->pac +k(); $mw-> Button( -text =>'Get Statistics', -command => \&get_statistics ) +->pack(); MainLoop(); sub open_file { $open = $mw->getOpenFile(); # set it, } sub get_statistics { my $fastafile = $open; # and use it. print STDERR "selected file: $fastafile\n"; }
In reply to Re^7: Perl tk - How to integrate external scripts
by Eliya
in thread Perl tk - How to integrate external scripts
by Giorgio C
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |