in reply to "uhshifting" the diamond?
How about a do..while() so that the read happens at the end of the loop instead of the beginning:
#!/usr/bin/perl -w use strict; $_=<DATA>; (my ($first, $second), $_) = split(/\s+/, $_, 3); print "first: $first\n"; print "second: $second\n"; do{ print "rest: $_"; } while (<DATA>); __DATA__ This is line one! This is line two! This is line three! This is line four! This is line five!
Outputs:
first: This second: is rest: line one! rest: This is line two! rest: This is line three! rest: This is line four! rest: This is line five!
HTH
|
|---|