in reply to Listbox, radio buttons and text box in sub function?

The problem is that the line
my $localpath = $entry->get();

runs before the MainLoop(), so nothing is assigned to $localpath. That's why Entries have textvariables:

my $entry = $mw->Entry( -textvariable => \ my $localpath )->pack;

Update: It seems the last item in the list is not displayed, or rather, the Exit button is displayed over it. Don't put the button into the list, it might be better to use the unused $lsb frame for both the list and the button.

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: Listbox, radio buttons and text box in sub function?
by Ppeoc (Beadle) on Feb 10, 2016 at 18:01 UTC
    Hey, Thanks for the suggestion. Looks like I am still having issues with this as well. The text entered is being lumped into the array @choice1 i.e. it is the last element of the array and $localpath still has no value. Any suggestions??
      The problem probably comes from a part of the code you didn't show:
      my (@choice1, $localpath) = myListBox(qw( item1 item2 item3 ));

      This indeed doesn't work, as assignment to an array gobbles up all the values from the right hand side. Swap the arguments, or return an array reference.

      return ($localpath, @choice1) # ... my ($localpath, @choice1) = myListBox(qw( item1 item2 item3 )); # OR return (\@choice1, $localpath) # ... my ($choice_ref, $localpath) = myListBox(qw( item1 item2 item3 ));
      ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
        Thanks a ton! Works like a charm