Dear Gentle Readers,
Please be gentle with me as this is only my first day trying to learn perl. I am using an online tutorial, however it must be written for *nix and I am trying to use it on win32. man perl does not even work. I have already found some other differences. For example, the tutorial uses single quotes and to get anything to work I had to use double quotes. There must be other things that are different also. I tried to use the examples directly in an script that would be useful to me. Maybe I should have tried something a little simplier.
Any polite suggestions would be greatly appreciated.
Sincerely yours,
Robert Mark White
The attempted script is below Most of the lines below are directly from the tutorial
I dont thinks so
so.....what!
I think at least the "#" remark lines below should be correct!
---------------------------------------------------------------------------- ------------ # By RMW # using activeperl v5.8.0 for Win32-x86-multi-tread # Program to add file1 to file2 # examples from http://www.comp.leeds.ac.uk/Perl/filehandling.html
#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
You seriously need some reading manuals why dont you get a perl book for a starter
Anyways since you posted here
If you want to copy the lines from $inputfile to $outputfile then do this
# # Bla bla bla #
use strict
my $inputfile = '....'; my $outputfile = '....';
open IN , $inputfile || die "COuldnot open in file\n";
@lines = <IN>; # Not the best way but this is what your eg does
close IN; # file name not reqd here
# Use a different handl for output
open OUT , ">$outputfile" || die "COuldnot open out file\n";
print OUT , "@lines"; # Again not the best way , # and dont put an '=' here
close OUT
##################### EOF################
BTW did you try copy file2 file1 ;-)
Ram
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]