language: Perl (perl 5.16.2)
date: 212 days 6 hours ago
link:
visibility: public
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

    Array inside by_ref: 0 0 0
    Array changed: 0 0 0