aboutsummaryrefslogtreecommitdiff
path: root/Perl/Zinc
diff options
context:
space:
mode:
authoretienne2003-07-01 15:58:35 +0000
committeretienne2003-07-01 15:58:35 +0000
commit98baab100d78552c0a5dfd9ae711975d7b5aefcd (patch)
tree33da1053deed68fc91542eaf100aecbfbde46b41 /Perl/Zinc
parent2c31ddfa266dd7040a1e89b2df19b717f3ce16b9 (diff)
downloadtkzinc-98baab100d78552c0a5dfd9ae711975d7b5aefcd.zip
tkzinc-98baab100d78552c0a5dfd9ae711975d7b5aefcd.tar.gz
tkzinc-98baab100d78552c0a5dfd9ae711975d7b5aefcd.tar.bz2
tkzinc-98baab100d78552c0a5dfd9ae711975d7b5aefcd.tar.xz
Correction de bug sur retours de fonction non scalaires.
Diffstat (limited to 'Perl/Zinc')
-rw-r--r--Perl/Zinc/TraceErrors.pm14
1 files changed, 11 insertions, 3 deletions
diff --git a/Perl/Zinc/TraceErrors.pm b/Perl/Zinc/TraceErrors.pm
index 43c4e3d..0d1e64f 100644
--- a/Perl/Zinc/TraceErrors.pm
+++ b/Perl/Zinc/TraceErrors.pm
@@ -62,8 +62,12 @@ sub Tk::Zinc::WidgetMethod {
$filename="" unless defined $filename;
$line="" unless defined $line;
# invoke function possibly overloaded in other modules
- my $res;
- eval {$res = &$WidgetMethodfunction(@_) if $WidgetMethodfunction;};
+ my ($res, @res);
+ if (wantarray()) {
+ eval {@res = &$WidgetMethodfunction(@_) if $WidgetMethodfunction;};
+ } else {
+ eval {$res = &$WidgetMethodfunction(@_) if $WidgetMethodfunction;};
+ }
if ($@) {
print $bold."error:".$_bold." $filename line $line $name";
&printList (@args);
@@ -71,7 +75,11 @@ sub Tk::Zinc::WidgetMethod {
$msg =~ s/at .*//g;
print " ".$bold."returns".$_bold." $msg\n";
}
- return $res;
+ if (wantarray()) {
+ return @res;
+ } else {
+ return $res;
+ }
}