On 2012-12-06, at 7:59 PM, Ken Preslan <k...@preslan.org> wrote:
> I solved this problem in Perl/Tk with catch:
> Tk::catch { $string = $g_w_main->SelectionGet(); };
> 
> I assume this is just a mapping to Tcl's catch.  So, I can do:
> $string = Tkx::catch('selection get');
> 
> However, this just sets $string to the result of catch, a number.  How do
> I get the results of the 'selection get' assigned to a Perl variable?

This needs testing, but you want the multi-arg version of catch to get the 
result.

my $string;
if (Tkx::catch('selection get', \$string)) {
   # error occurred
} else {
   # $string should have result
}

Jeff

Reply via email to