open(FILEIN, "table.txt"); #numbers table which only has 0 and 1. open FILEOUT, ">>data.txt"; #opens data.txt in read-mode my $input="01110011001111100010111101011111000100110000000000000001111111101101111101011010"; my @seed = split //; while(){ #reads line by line from FILE which is the filehandle for data.txt #chomp; my $temp=''; my @ca = split //; #$_ =~ tr/ /\n/; my $count = 0; foreach my $digit (@ca){ @seed[$count] = @seed[$count] - $_; $count++; } print FILEOUT "@seed\n"; #shows you what we have read } close FILEIN; close FILEOUT;