$mw->Button (-text => 'Exit', -command => sub {$mw->destroy}) ->grid (-row => $row, -column => $col++, @pad); $mw->Button (-text => 'Save data ...', -command => sub { my $file = $mw->getSaveFile (-filetypes => [ ['Text files', '.txt', 'TEXT'], ['All files', '*'], ], -initialfile => $dsdata{$command}, -defaultextension => '.txt'); return unless defined $file && $file ne ''; $rslt = $st->$command ($dsxfrm{$command} ? ($dsxfrm{$command}->($dsdata{$command})) : $dsdata{$command}); if ($rslt->is_success) { my $fh; $fh = FileHandle->new (">$file") and print $fh $rslt->content or $mw->messageBox (-icon => 'error', -type => 'OK', -title => 'File open error', -message => $!); } else { $mw->messageBox (-icon => 'error', -type => 'OK', -title => 'Data fetch error', -message => $rslt->status_line); } }) ->grid (-row => $row, -column => $col++, @pad);