On Dec 5, 2003, at 11:20 PM, sadman wrote: [..]
i have lert a few basics but still im stuck on a problem ;-(
[..]
What i need to do now is instaed of having the text in the code,
have it open up another txt file read the whole txt file and then
add all the text from that said file to the end of the outfile,
im sure this is simple but ive obviously missed something somewere ;-(

Now we are moving into the land of choices.


we need an input file, and an output file
to append it to???

say something like

cat inputfile >> outputfile

???
but in perl in the form

append_file inputfile outputfile

????
        my ($input_file , $output_file)  = @ARGV;

        open(IN, "$input_file") or die "problem with inputfile: $!\n";
        open(OUT, ">>$output_file") or die "problem with output_file: $!\n";
        
        print OUT $_ while(<IN>);
        
        close(IN);
        close(OUT);



ciao
drieux

---


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to