$$a =~ s/^\s+//; # remove leading white space from $array[3] $$b =~ s/\s+$//; # and trailing ws from $array[5] $$c++; # incremnt $array[7]