List Info

Thread: 5.9.5 breaks funky $#




5.9.5 breaks funky $#
user name
2007-08-26 18:50:26
Maybe it should break it, cos it's some funky and quite
possibly just
plain broken syntax, but ...

$ perl-5.8.8/bin/perl -e '$foo=[qw(a b c)];print $#{$foo}."n"'
2
$ perl-5.9.5/bin/perl5.9.5 -e '$foo=[qw(a b c)];print
$#{$foo}."n"'
-1

With strictness turned on ...

$ perl-5.9.5/bin/perl5.9.5 -Mstrict -e '
    my $foo=[qw(a b c)];print $#{$foo}."n"'
Can't use string ("3") as an ARRAY ref ...

whereas perl 5.8.8's strict.pm is silent on the matter.

-- 
David Cantrell | Cake Smuggler Extraordinaire

More people are driven insane through religious hysteria
than
by drinking alcohol.    -- W C Fields

Re: 5.9.5 breaks funky $#
user name
2007-08-27 09:58:34
David Cantrell wrote:
> Maybe it should break it, cos it's some funky and quite
possibly just
> plain broken syntax, but ...
> 
> $ perl-5.8.8/bin/perl -e '$foo=[qw(a b c)];print
$#{$foo}."n"'
> 2
> $ perl-5.9.5/bin/perl5.9.5 -e '$foo=[qw(a b c)];print
$#{$foo}."n"'
> -1
> 
> With strictness turned on ...
> 
> $ perl-5.9.5/bin/perl5.9.5 -Mstrict -e '
>     my $foo=[qw(a b c)];print $#{$foo}."n"'
> Can't use string ("3") as an ARRAY ref ...
> 
> whereas perl 5.8.8's strict.pm is silent on the
matter.

I'm wondering if #25808 is the cause? Maybe Andreas can run
his magic 
diff machine on either side of this patch?

http://public.activestate.com/cgi-bin/perlbrowse?pat
ch=25808

Thanks,
David




Re: 5.9.5 breaks funky $#
user name
2007-08-27 10:18:40
David Landgren wrote:
> David Cantrell wrote:
>> Maybe it should break it, cos it's some funky and
quite possibly just
>> plain broken syntax, but ...
>>
>> $ perl-5.8.8/bin/perl -e '$foo=[qw(a b c)];print
$#{$foo}."n"'
>> 2
>> $ perl-5.9.5/bin/perl5.9.5 -e '$foo=[qw(a b
c)];print $#{$foo}."n"'
>> -1
>>
>> With strictness turned on ...
>>
>> $ perl-5.9.5/bin/perl5.9.5 -Mstrict -e '
>>     my $foo=[qw(a b c)];print $#{$foo}."n"'
>> Can't use string ("3") as an ARRAY ref
...
>>
>> whereas perl 5.8.8's strict.pm is silent on the
matter.
> 
> I'm wondering if #25808 is the cause? Maybe Andreas can
run his magic 
> diff machine on either side of this patch?
> 
> http://public.activestate.com/cgi-bin/perlbrowse?pat
ch=25808

Indeed, I think this is the cause.

JFTR, $foo is being evaluated in scalar context, returns
the number of 
elements in $foo (3), and "3" cannot be used as an
array reference. The 
call back in May was that this was the more desirable
behaviour.

http://www.xray.mpe.mpg.de/mailing-l
ists/perl5-porters/2006-05/msg00435.html

David


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )