in reply to Re: How can I concatenate two files?
in thread How to concatenate the contents of two files?

That's not portable. You should use binmode on your handles.

Also, <BAR> could return an arbitrary long line. You can limit the size of that line using $/ = \4096;.