similar Perl data structure?

D

dfighter

Curtis 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.
Well he did mention he stored the string in an array, so I assumed he
needs to store them. If he doesn't then we ofc agree.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,796
Messages
2,569,645
Members
45,366
Latest member
GayT017679

Latest Threads

Top