Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: This is a small bug in TableMatrix.pm, right??

by gamache (Friar)
on Dec 20, 2007 at 19:30 UTC ( [id://658219] : note . print w/replies, xml ) Need Help??


in reply to This is a small bug in TableMatrix.pm, right??

eval sets $@ to an error message if the eval'ed block generated an error, and clears $@ otherwise. The eval {...}; if ($@) {...} construct is Perl's version of try and catch.

Replies are listed 'Best First'.
Re^2: This is a small bug in TableMatrix.pm, right??
by gleepglop (Novice) on Dec 20, 2007 at 20:22 UTC

    OK, I see, but the statment $data = $w->GetSelection() does result in $@ being set inside the eval if there is no selection available. But GetSelection still returns and so the eval executes fine and resets $@ to empty. This must mean that GetSelection() is doing some sort of error trapping of it's own, right?<\p>