I've looked throgh the recent archives. A lot of what is being discussed seems too 
'advanced' for me. I guess i'm a REAL baby newbie.

Can someone please look at the following project, and tell me why it is not writing 
the contents of the readfile.txt to the writefile.txt? 

It's tough to learn from a book, when there is no one to help you, and no examples of 
the project anywhere. I wish I could get a free personal tutor. Anyone interested? 
heh. 

Here is what i've got so far:

---------------------

# Description:A program that can save the contents of a given file and create a
# new file in the same directory that contains a copy of the original files information
# Revision History:
#     1.0/July 18th 2002: original version
#-----------------------------------------------------------------

# open files for reading(readfile.txt) and writing(writefile.txt)
open (READFILE, "readfile.txt") || die "could not open readfile.txt \n";
open (WRITEFILE, ">writefile.txt") || die "could not open writefile.txt \n";

# define contents of readfile.txt to array
@contents = <READFILE>;

# print contents to the writefile
print (@contents);

# close readfile and writefile
close (READFILE); 
close (WRITEFILE);

# open writefile.txt to read contents
open (NEWWRITEFILE, "writefile.txt") || die "could not open writefile.txt\n";

# assign contents of writefile.txt to an array
@newcontents = <NEWWRITEFILE>;

# print the contents of writefile.txt
print "\n The contents of writefile.txt is $newcontents \n";

# close writefile.txt
close (NEWWRITEFILE);

-----------------------------

Thank you,
Carrie Lyn

Reply via email to