Readers:
awk has a function  called 'getline' which reads the next line of input
without changing control of the script.

My input file contains pairs of records. When I find a record that matches
my search pattern, I want that record and the next record. 
In awk, I used the 'getline' which did just that.

How can I do this in perl?
Does using the $* variable get me there?
--------------------------------------------------
#!/usr/bin/perl -w
use strict ;
## If the record ends in 03 then capture this record and the next one.
while (<>) {
chomp ;

if ( /03$/)  {
print ; #print this record, now how do I capture just the next record?
}
------------------------------------------------------------

Thanks,

Frank

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to