Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Modify code helpby jamen_98 (Initiate) |
on Mar 26, 2004 at 19:45 UTC ( [id://340126]=perlquestion: print w/replies, xml ) | Need Help?? |
jamen_98 has asked for the wisdom of the Perl Monks concerning the following question: I have a script that pulls the first line of the file below. The file looks like:
Many times it will only be 1 line long of data but it could be up to three. I need to extract the 1 and 5 and put it into a new file. Currently I only need to pull the first line, but in the near future I need unlimited. This code works great for one line. I like the idea of just reading the line and then outputting it directly into the file, however when doing two lines, whether I use the \n or not, I only end up with the very last line (ie: 5). The code that works beautifully for one line is:
Any ideas on how to edit this to write out more
than one slot number to the out file is appreciated!
Back to
Seekers of Perl Wisdom
|
|