Skip Menu |

This queue is for tickets about the Tk CPAN distribution.

Report information
The Basics
Id: 25118
Status: resolved
Priority: 0/
Queue: Tk

People
Owner: Nobody in particular
Requestors: at [...] altlinux.ru
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 804.027_500



Subject: [PATCH] Tk/Trace.pm: fix perl syntax
Date: Sat, 24 Feb 2007 15:42:10 +0300
To: bug-tk [...] rt.cpan.org
From: Alexey Tourbin <at [...] altlinux.ru>
Recent perl-5.8 snapshots (perl-5.8.9 to-be) no longer allow $#{@ary} syntax. http://www.nntp.perl.org/group/perl.perl5.porters/119879 http://www.nntp.perl.org/group/perl.perl5.porters/119881 http://www.nntp.perl.org/group/perl.perl5.porters/119882 http://www.nntp.perl.org/group/perl.perl5.porters/119883 --- Tk/Trace.pm | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tk/Trace.pm b/Tk/Trace.pm index 1e38e79..46695ed 100644 --- a/Tk/Trace.pm +++ b/Tk/Trace.pm @@ -49,7 +49,7 @@ sub fetch { return $val unless $call->[0]; # if fetch inactive my $final_val; - foreach my $aref (reverse @$call[ 1 .. $#{@$call} ] ) { + foreach my $aref (reverse @$call[ 1 .. $#$call ] ) { my ( @args_copy ) = @$aref; my $sub = shift @args_copy; # user's callback unshift @_, undef if scalar @_ == 0; # undef "index" for a scalar @@ -86,7 +86,7 @@ sub store { my $call = $TRACE{$aref->[0]}->[1]->{-store}; # active flag/callbacks return $val unless $call->[0]; # if store inactive - foreach my $aref ( reverse @$call[ 1 .. $#{@$call} ] ) { + foreach my $aref ( reverse @$call[ 1 .. $#$call ] ) { my ( @args_copy ) = @$aref; my $sub = shift @args_copy; # user's callback unshift @_, undef if scalar @_ == 1; # undef "index" for a scalar @@ -118,7 +118,7 @@ sub destroy { my $call = $TRACE{$aref->[0]}->[1]->{-destroy}; # active flag/callbacks return $val unless $call->[0]; # if destroy inactive - foreach my $aref ( reverse @$call[ 1 .. $#{@$call} ] ) { + foreach my $aref ( reverse @$call[ 1 .. $#$call ] ) { my ( @args_copy ) = @$aref; my $sub = shift @args_copy; # user's callback my $val = $self->Fetch(@_); # get final value -- 1.5.0.1.GIT
On Sat Feb 24 07:32:49 2007, at@altlinux.ru wrote: Show quoted text
> Recent perl-5.8 snapshots (perl-5.8.9 to-be) no longer allow > $#{@ary} syntax. > > http://www.nntp.perl.org/group/perl.perl5.porters/119879 > http://www.nntp.perl.org/group/perl.perl5.porters/119881 > http://www.nntp.perl.org/group/perl.perl5.porters/119882 > http://www.nntp.perl.org/group/perl.perl5.porters/119883 > > --- > Tk/Trace.pm | 6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/Tk/Trace.pm b/Tk/Trace.pm > index 1e38e79..46695ed 100644 > --- a/Tk/Trace.pm > +++ b/Tk/Trace.pm > @@ -49,7 +49,7 @@ sub fetch { > return $val unless $call->[0]; # if fetch inactive > > my $final_val; > - foreach my $aref (reverse @$call[ 1 .. $#{@$call} ] ) { > + foreach my $aref (reverse @$call[ 1 .. $#$call ] ) { > my ( @args_copy ) = @$aref; > my $sub = shift @args_copy; # user's callback > unshift @_, undef if scalar @_ == 0; # undef "index" for a
scalar Show quoted text
> @@ -86,7 +86,7 @@ sub store { > my $call = $TRACE{$aref->[0]}->[1]->{-store}; # active flag/callbacks > return $val unless $call->[0]; # if store inactive > > - foreach my $aref ( reverse @$call[ 1 .. $#{@$call} ] ) { > + foreach my $aref ( reverse @$call[ 1 .. $#$call ] ) { > my ( @args_copy ) = @$aref; > my $sub = shift @args_copy; # user's callback > unshift @_, undef if scalar @_ == 1; # undef "index" for a
scalar Show quoted text
> @@ -118,7 +118,7 @@ sub destroy { > my $call = $TRACE{$aref->[0]}->[1]->{-destroy}; # active
flag/callbacks Show quoted text
> return $val unless $call->[0]; # if destroy inactive > > - foreach my $aref ( reverse @$call[ 1 .. $#{@$call} ] ) { > + foreach my $aref ( reverse @$call[ 1 .. $#$call ] ) { > my ( @args_copy ) = @$aref; > my $sub = shift @args_copy; # user's callback > my $val = $self->Fetch(@_); # get final value
Thanks. This is already fixed in the development version of Tk: r8936 | eserte | 2006-11-20 23:20:22 +0100 (Mo, 20 Nov 2006) | 3 lines r1244@biokovo: eserte | 2006-11-20 21:20:09 +0100 fixed wrong usage of $#{@...} which does not work anymore in bleedperl Regards, Slaven