It seems that the code is also incomplete, so we cannot try to reproduce your error. Could you please update your question with the full ./file_delimiter.pl script? If it's too large, at least the missing part that calls to delimit(...) would be fine.
BTW, don't forget to enclose the code with <code> ... </code> tags.