Subject: | fix for deprecated warnings |
Hello,
I have perl-5.8.2 on Linux and Solaris; with Set-Array-0.10 I get
warnings about a deprecated syntax (using array as reference).
The patch below fixes this problem, and should be backward
compatible with perls down to 5.005, as far as I can tell.
Best regards,
Marek
--- Set-Array-0.10/Array.pm 2002-07-29 02:52:58.000000000 +0200
+++ Set-Array-0.10p1/Array.pm 2003-12-10 15:19:16.000000000 +0100
@@ -217,13 +217,13 @@
if( (want('OBJECT')) || (!defined wantarray) ){
for(my $n=0; $n<=$#$self; $n++){
- if( ref(@{$self}[$n]) eq 'ARRAY' ){
- CORE::splice(@{$self},$n,1,@{@{$self}->[$n]});
+ if( ref($self->[$n]) eq 'ARRAY' ){
+ CORE::splice(@{$self},$n,1,@{$self->[$n]});
$n--;
next;
}
- if( ref(@{$self}[$n]) eq 'HASH' ){
- CORE::splice(@{$self},$n,1,%{@{$self}->[$n]});
+ if( ref($self->[$n]) eq 'HASH' ){
+ CORE::splice(@{$self},$n,1,%{$self->[$n]});
--$n;
next;
}