in reply to Return value from Button event

Based on some things in your post, I'm assuming that your doing some GUI work. Also, since some of the syntax doesn't look quite like what I remember from Win32::GUI, I'm assuming that you're using Tk or some other GUI module.

Going off of those assumptions, here's the concept of what I've done using Win32::GUI. If you're using something else, you should still be able to apply the concepts with the module(s) that you're using.

This allows for the selected path to be accessible by retrieving the text value of the textfield. If for some reason you can't use a textfield (or don't want to use one), then I'd agree with previous reply about using global variables.