in reply to Open a file using Tkx package

# your code is: our $cb = $frame->new_ttk__button(-text => "Calculate"); our $filename = $cb->getOpenFile();
I don't use Tkx, but from basic knowledge of buttons and callbacks, you don't have a callback for the button. Your code should look something like this:
our $cb = $frame->new_ttk__button( -text => "Calculate", -command => sub{ our $filename = $cb->getOpenFile(); } );
See Tkx tutorial

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh