do { BLOCK } until $cond; executes the BLOCK at least once. Therefor, your next gets executed immediately and aborts the current iteration of the while loop. As a result, nothing ever gets printed.
Further, the until indicates looping, but you don't iterate over anything in your BLOCK so it should be if.
What you really want is a first loop that skips all the junk, and then a second one that does the work.
do { $_ = <LOG> } until m/SCHEDULEREC OBJECT BEGIN SERVER_DAILY $date/ or not define +d; do { print ("$. : $_") if m/SCHEDULEREC OBJECT BEGIN SERVER_DAILY $date/ +; print ("$. : $_") if m/SCHEDULEREC OBJECT END SERVER_DAILY $date/; print ("$. : $_") if m/ANS1228E Sending of object '(.*)' failed/ $_ = <LOG>; } until not defined;
Makeshifts last the longest.
In reply to Re: skipping lines in a file until regexp matches
by Aristotle
in thread skipping lines in a file until regexp matches
by blueflashlight
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |