D
dfighter
Well he did mention he stored the string in an array, so I assumed heCurtis said:You don't even need to store the lines in an array in Perl, if all
you do is output the file.
As far as I can tell, the OP doesn't explicitly require storing the
lines in memory before outputting. Therefore, it seems using an
approach like Nick Keighley's suggestion would be sufficient and much
simpler.
@OP: if you want to sort the lines, or otherwise do something with
the lines, before outputting, you might want to learn about "ragged
arrays" in C. Check out Question 20.2 in the C FAQ:
<http://www.c-faq.com/>
There's a fair amount of C fundamentals underlying this task, so you
may want to start with some beginner tutorials or K&R2, if you're
willing to purchase it (well worth the money). For some recommended
resources on the net, again, check the C FAQ, Question 18.9.
needs to store them. If he doesn't then we ofc agree.