Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
"uhshifting" the diamond?by glwtta (Hermit) |
on Oct 21, 2003 at 00:32 UTC ( [id://300797]=perlquestion: print w/replies, xml ) | Need Help?? |
glwtta has asked for the wisdom of the Perl Monks concerning the following question:
Hello, I am doing something rather simple - iterating over the lines from <> and splitting each one into words. What I can't seem to figure out how to do, is grab the first two words from the first line, and then continue on as usual. In other words, I want to my $first_line = <>; my ($word1, $word2) = split /\s+/, $first_line; while(<>){...} but still have the rest of $first_line be processed in the wile(<>). Am I missing something obvious? (Oh, I wouldn't want to slurp the whole thing into RAM first, as the input can get rather largish)
Back to
Seekers of Perl Wisdom
|
|