I have an array reference $data from which I have extract the values.Currently, when I do a Dumper on $data it is as below:
print Dumper @$data;
The output is:
$VAR1 = ' ANC';
$VAR2 = 'BET';
How can I access the elements in $Var2?
I have an array reference $data from which I have extract the values.Currently, when I do a Dumper on $data it is as below:
print Dumper @$data;
The output is:
$VAR1 = ' ANC';
$VAR2 = 'BET';
How can I access the elements in $Var2?
Also, you can use $$data[1], since $data is a reference to an array, you can use it just like an ordinary array, $data is the name, so you can use @$data represent the whole array, and $$data[n] to access element in array.
There is more than one way to do it!