in reply to removing the delimiter

(This appears to be a followup to the OP's very recent thread.)

@delimiter_to_remove=~s/\$delimiter_used/\n/g;

There are four problems in that line.

Fix:

$data_to_read =~ s/\Q$delimiter_used\E/<br>/g;

Or if you plan on having more than one element in @delimiter_to_remove,

s/\Q$delimiter_used\E/<br>/g for @delimiter_to_remove;