kaushikrvs
Member level 5
@list_1 = (1,2,3,4,5,6,7,8,9,10);
@list_odd = @list_1[0,2,4,6,8];
@list_prime = @list_1[1,2,4,6];
foreach $x (@list_odd) { print @list_odd[$x];}
Output : 3 , 7
For some reason, it's not showing the remaining elements of the list. Can anyone help me with it?
@list_odd = @list_1[0,2,4,6,8];
@list_prime = @list_1[1,2,4,6];
foreach $x (@list_odd) { print @list_odd[$x];}
Output : 3 , 7
For some reason, it's not showing the remaining elements of the list. Can anyone help me with it?