Re: Newbe needs help
From: Drieux (drieux_at_wetware.com)
Date: 12/06/03
- Previous message: Drieux: "Re: Pattern matching"
- In reply to: Sadman: "Re: Newbe needs help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 6 Dec 2003 10:30:35 -0800 To: Perl Perl <beginners@perl.org>
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
---
- Previous message: Drieux: "Re: Pattern matching"
- In reply to: Sadman: "Re: Newbe needs help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|