$frame->DragAcceptFiles(1); EVT_DROP_FILES( $frame, \&ondrop ); EVT_BUTTON( $frame, $ButExtract, \&onExtract ); ## its like ## EVT_BUTTON( $parent, $child, \&callback ); ## EVT_BUTTON( $parent, $child->GetId, \&callback ); ... sub ondrop { my( $frame, $wxDropFilesEvent ) = @_; my @files = $wxDropFilesEvent->GetFiles; $frame->{you_chose_these_files} = \@files; ## extract( $files[0] ); ## or whatever } sub onExtract { my( $frame, $extractBut ) = @_; my( $firstFile ) = @{ $frame->{you_chose_these_files} }; extract( $firstFile ); ... }