return ($localpath, @choice1) # ... my ($localpath, @choice1) = myListBox(qw( item1 item2 item3 )); # OR return (\@choice1, $localpath) # ... my ($choice_ref, $localpath) = myListBox(qw( item1 item2 item3 ));