1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | use warnings; use strict; my @array = (1,2,3,4,5); my $v = 1; sub by_ref { my ($array_ref,$v) = @_; @$array_ref = (0,0,0); print "Array inside by_ref: @$array_ref\n"; } by_ref(\@array,$v); print "Array changed: @array\n"; |
-
upload with new input
-
result: Success time: 0s memory: 4684 kB returned value: 0
use warnings; use strict; my @array = (1,2,3,4,5); my $v = 1; sub by_ref { my ($array_ref,$v) = @_; print "$array_ref[1]"; @$array_ref = (0,0,0); print "Array inside by_ref: @$array_ref\n"; } my @b = @array; by_ref(\@b,$v); @array = @b;Array inside by_ref: 0 0 0 Array changed: 0 0 0
-
result: Success time: 0s memory: 4684 kB returned value: 0
use warnings; use strict; my @array = (1,2,3,4,5); my $v = 1; sub by_ref { my ($array_ref,$v) = @_; print "123 $array_ref[1]"; @$array_ref = (0,0,0); print "Array inside by_ref: @$array_ref\n"; } my @b = @array; by_ref(\@b,$v); @array = @b; print "Array changed: @array\n";Array inside by_ref: 0 0 0 Array changed: 0 0 0
-
result: Success time: 0s memory: 4684 kB returned value: 0
use warnings; use strict; my @array = (1,2,3,4,5); my $v = 1; sub by_ref { my ($array_ref,$v) = @_; print "$array_ref[1]"; @$array_ref = (0,0,0); print "Array inside by_ref: @$array_ref\n"; } my @b = @array; by_ref(\@b,$v); @array = @b; print "Array changed: @array\n";Array inside by_ref: 0 0 0 Array changed: 0 0 0
-
result: Success time: 0s memory: 4684 kB returned value: 0
use warnings; use strict; my @array = (1,2,3,4,5); my $v = 1; sub by_ref { my ($array_ref,$v) = @_; print "$array_ref[1]"; @$array_ref = (0,0,0); print "Array inside by_ref: @$array_ref\n"; } my @b = @array; by_ref(\@b,$v); @array = @b; print "Array changed: @array\n";Array inside by_ref: 0 0 0 Array changed: 0 0 0
-
result: Success time: 0s memory: 4684 kB returned value: 0
use warnings; use strict; my @array = (1,2,3,4,5); sub by_ref { my $array_ref = @_; @$array_ref = (0,0,0); print "Array inside by_ref: @$array_ref\n"; } by_ref(\@array); print "Array inside : @array\n";Array inside by_ref: 0 0 0 Array changed: 0 0 0
-
result: Success time: 0s memory: 4684 kB returned value: 0
Array inside by_ref: 0 0 0 Array changed: 0 0 0


