Perl array element manipulation -
I was trying and trying with this one, but it just does not seem to be the click if I have a Array, then say 6 numbers:
@ a = (1,2,3,4,5,6) -
How do I get every other index (2, 4, 6) in this matter?
-
How do I calculate the difference of every two elements, then the output will be here:
1 1 1 (because 2-1 = 1 and 4-3 = 1 and so on ..) $ a or $ b , they are special (< Code> sorting using them ...) ... is usually better for giving your variable a descriptive name, letting it know as to what kind of variable it is (my $ index = 0; $ index
Comments
Post a Comment