in reply to Re: What is the easiest way to copy one file to another?
in thread What is the easiest way to copy one file to another?

Ugh. Use File::Copy. Or, at least, skip the slurp. :)
open(FROM, 'file.txt') or die "Can't open file.txt: $!"; open(TO, '>copied_file.txt') or die "Can't open copied_file.txt: $!"; print TO while <FROM>;