NAME

File::Copy - Copy files or filehandles

USAGE

  	use File::Copy;

	copy("file1","file2");
  	copy("Copy.pm",\*STDOUT);'

  	use POSIX;
	use File::Copy cp;

	$n=FileHandle->new("/dev/null","r");
	cp($n,"x");'

DESCRIPTION

The Copy module provides one function (copy) which takes two parameters: a file to copy from and a file to copy to. Either argument may be a string, a FileHandle reference or a FileHandle glob. Obviously, if the first argument is a filehandle of some sort, it will be read from, and if it is a file name it will be opened for reading. Likewise, the second argument will be written to (and created if need be).

You may use the syntax use File::Copy "cp" to get at the "cp" alias for this function. The syntax is exactly the same.

RETURN

Returns 1 on success, 0 on failure. $! will be set if an error was encountered.

AUTHOR

File::Copy was written by Aaron Sherman <ajs@ajs.com> in 1995.