I am having problem with passing array reference to sub-routine. I think I should be doing a small mistake somewhere.
The output I get is:
Above function: 1234567
In function:
Where am I doing wrong? THanks in advance.
Code:
print "Above function: $data[0]\n";
my $line = array_refer("\@data");
sub array_refer {
my @data = @$_[0];
print "In function: $data[0]\n";
}
The output I get is:
Above function: 1234567
In function:
Where am I doing wrong? THanks in advance.