$AZ_len = 10; &update_google ($az_state, $AZ_len); sub update_google { my($infile, $col_length) = @_; #Open files to read from open GOOG, "<", $infile or die $!; $count = 6; while () { @test1 = split(/ /); my @aoh = map { {row => $count, col => $_+2, input_value => $test1[$_]} } 0 .. 4; $googlesheet->batchupdate_cell(@aoh); $count++; } close(GOOG); } # $infile looks like this 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 5 0 0 0 0 0 0 0 0 4 6 0 0 0 0 0 0 0 0 5 4 0 0 0 0 0 0 0 0 0 0 0 0 0 #Google spreadsheet only prints this 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0