You use both $white-> and $white{...} (similarly for most of the other errors). The $white-> variant is using white as a scalar and the $white{...} variant is using white as a hash. You have either missed declaring the hash or, more likely, the second variant should be $white->{...}.
Because you haven't given enough context it is impossible for us to tell which way around the code should be.
The $diff_file error is fixed by prefixing the statement where it is assigned a value with my.
Premature optimization is the root of all job security