in reply to Can't get a simple log creator to work!

Just commenting out the second open works for me, but there are still problems with your script.

You use strict; which is good, but you should also use warnings;
Giving the filename the suffix ".rtf" does not make it a rich text file, it is just a plain text file (apologies if you knew that).
When you print "@stuff" the action of the double quotes is to place (by default) a space between each element, and this will appear in the file.
Here is a tided version:
#!/usr/bin/perl #this program is supposed to take user input put it into an array and +then add #that text into a log file. use 5.010; use strict; use warnings; print "Enter some text then hit control+D and we'll try to send it to +the perlogfile:\n"; my @stuff = <STDIN>; open (LOG, '>>', 'perlogfile.rtf') or die "Unable to open logfile: $!" +; print LOG @stuff; close (LOG);


File handle
When a program asks the operating system to use a file (open) then several checks have to be made. Obviously it has to find where the physical file is, but it also has to check the file permissions against (on UNIX) the process's user id and maybe group id. To do that (again, on UNIX) it has to read from disc the file's inode. Clearly all that is a lot of work and takes time. If we had to do that every time we wanted to write a line to a file then things would be slow. So, we open the file just once and store all that information internally in RAM, so that it can be referred to whenever we want to write to the file. The file handle is our reference to that internal information, so we use that each time we access the file.
Downside is that this information uses up memory, so we tidy it all up when we do a close.

Perl is not alone in using this mechanism - most programming languages do something similar. To complicate matters, there are (at least) two ways to describe a file handle. You are using the old-fashioned way with an uppercase global name - LOG. That's often good enough, and still very commonly used. A more modern way is to use a lexical variable, which has the advantage (among others) of not being global - important in a large multi-file application
open (my $fh, '>>', 'perlogfile.rtf') or die "Unable to open logfile: +$!"; print $fh @stuff; close ($fh);