in reply to Strange Tk Frame Behavior - SOLVED

Not to take anything away from zentaras answer, Pane very likely is a better way to go. However, it seems to me just adding a "raise" to your 'Put text in frame' button command will make it do what you (or I, at least,) would expect.

$top->Button(-text=>'Put text into frame', -command=>sub{ if(!$frame){return}; $text->packForget; $text->pack(-in=>$frame); $text->raise; #<=== Add this line })->pack;