in reply to What is the easiest way to copy one file to another?
Probably not as efficient as a system call.open (FH, "file.txt") or die "$!"; undef $/; $slurped_file = <FH>; # whole file resides in $slurped file now. open (CFH, ">copied_file.txt") or die "$!"; print CFH $slurped_file; # file.txt contents now reside in copied_file.txt. # close your filehandles.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: What is the easiest way to copy one file to another?
by chromatic (Archbishop) on Oct 31, 2001 at 02:17 UTC |