in reply to Return value from Button event

Shortest solution is to make $filepath a global variable, or you could store it as your mainwindow attribute
$mw->{_my_store}{filepath}
Coping with Scoping