Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
How to parse a scalar variableby cajun (Chaplain) |
on Jun 05, 2005 at 05:49 UTC ( [id://463656]=perlquestion: print w/replies, xml ) | Need Help?? |
cajun has asked for the wisdom of the Perl Monks concerning the following question:
I recently needed to parse the first few lines of some fairly large files. During my research in trying to figure out how to read just a few lines from a file, then move on to the next file, I found Jumping out of a partially read file.
This node solve my quest for how to read just a few lines from each file. However it left me with a different question. While I'm very accustomed to opening a file and processing it line by line, I've never done this with a scalar variable (ref: $header in Jumping out of a partially read file. I'm fairly sure the answer is simple, however in many searches on Perlmonks.org as well as Google, and of course "Learning Perl", the solution has not yet become clear. My $header scalar contains data that looks like this: Thanks for any suggestions, Mike
Back to
Seekers of Perl Wisdom
|
|