Ok, since you didn't detail the criteria you need to adapt this as required
poj#!perl use warnings; use strict; my $criteria; while (<>) { next unless /\S/; # skip blank lines if (/(Relay access denied|blocked using)/){ $criteria = $1; next; } if (/\d+\s+(\S+)/ && defined $criteria){ print "update db $criteria = $1\n"; } else { $criteria = undef; } }
In reply to Re^7: Loop problem: jumps one record
by poj
in thread Loop problem: jumps one record
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |