Robert -- ...and then Robert Mark White said... % % Dear Gentle Readers, % % Please be gentle with me as this is only my first day trying to learn perl.
Hey, we've all been there :-) I can't recommend highly enough the "Learning Perl" and "Programming Perl" books. I read "Learning" to get started and now, since I don't get to do as much perl as I'd like and am forever rusty, I refer often to "Programming", which my then-4-year-old daughter already knew as 'The Camel Book' :-) ... % The attempted script is below ... % #name the files % $file1 = "c:\Program Files\ArGo Software Design\Mail Server\Keyring_ALL"; # % Name for file1 % $file2 = "c:\PGP\pgp-all.asc"; # Name for file2 % % open(INFO, ">$file2"); # Open file2 for output % @lines = <INFO>; # Read file2 into an array % close(INFO, "$file2"); # Close the file2 % % open(INFO, "<$file1"); # Open file1 for input % print <INFO> = @lines; # Print the array into file1 % close(INFO, "$file1"); # Close the file1 First, think of "input" and "output" as relative to your script rather than relative to some files. I'm going to hypothesize that you want to read in from file1 and then write out to file2 rather than the other way around, which you may or may not have gathered from the other helpful replies you've seen here. That will make all of your backwards problems turn right around. In addition, I haven't seen anyone point it out yet, but I rather doubt that you want to flatly overwrite your pgp-all file but guess that instead you want to append to it. For that you should open (OUTPUT,">>$file2") ; noting well the '>>' meaning "append" rather than "start right at the beginning and step on anything else that was there". HTH & HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
pgp00000.pgp
Description: PGP signature