in reply to special variable?

Lawliet has correctly diagnosed your problem: that you should not assign to the $' special variable (see perlvar).

However, I do not understand why you are trying to use that variable at all in your code. If you are trying to join and split using "|" as a delimiter, you can just do:

print DAT join('|', @input_to_file), "\n"; @data_to_print=split /\|/, $data_to_read;