$mw->Button(-text => "Extract", -command => sub { getData( $worksheet ) })-> ...