in reply to subtract two columns from perl arrays

If you have @arrays, your problem may simply be wrong terminology. What you are seeing as two columns, probably are indices and values.
You could try
use strict; use warnings; use Data::Dumper; # your code for creating @array1 and @array2 goes here print Dumper(\@array1); print Dumper(\@array2);
and show us the output.