![]() |
|
Think about Loose Coupling | |
PerlMonks |
Processing lines after a pattern in a while loopby NovMonk (Chaplain) |
on Apr 05, 2004 at 16:24 UTC ( #342664=perlquestion: print w/replies, xml ) | Need Help?? |
NovMonk has asked for the wisdom of the Perl Monks concerning the following question:
Greeting fellow monks. I should start by saying I'm still very new to Perl, and that this is only homework in the sense that I am trying to remedy my ignorance. I want to know whether or not something is possible, and where I should go to read and learn more. Here's my situation: I have an input file with some junk at the top of it, and then some lines I want to do something with. I know the last line of junk contains a certain pattern. What I wanted to do was tell Perl to start doing stuff after it read the line with that pattern in it. But I'm not sure how to do that within the while loop, or even if that's possible. What I ended up doing, because I knew how, was to identify and skip the junk lines (all of which begin with either "qcp" or "#", or are blank) and then process all the other lines the way I wanted to, thus:
If I know that #cardtype Always begins the last line of junk, what could I do instead? Thanks for any insight or wisdom you care to offer. Pax, NovMonk
Back to
Seekers of Perl Wisdom
|
|