in reply to Write to different file name

um, like this?:
$text = file1.txt open (DAT,"$text"); @stuff = <DAT>; close(DAT); open (NEWDAT, ">file2.txt"); print @stuff; close(NEWDAT);
Or use File::Copy like this:
#!/usr/bin/perl -w use File::Copy; copy ("file1.txt","file2.txt"); print "Content-type: text/html\n\n"; #just to check... if (-e "file2.txt"){ print "File copied"; }