swkronenfeld has asked for the wisdom of the Perl Monks concerning the following question:
Here's my code,. <snip> . ClientSystemName (clisysname): 'SPIFF', Client LongId: '0008027E1180,/ +epic/tst/cachesys/mgr/' PIDTAB for 128 jobs: (Job:PID:reswake:sflg[:D if dead] Job: PID:resw:SF:D 1: 5382 :0:0 2: 5384 :0:0 3: 5385 :0:0 4: 5386 :0:0 5: 5394 :0:0 6: 5387 :0:0 7: 5388 :0:0 8: 5389 :0:0 9: 5390 :0:0 10: 5391 :0:0 11: 5392 :0:0 12: 5393 :0:0 13: 5456 :0:0 14: 5444 :0:0 15: 5445 :0:0 16: 14682 :1:0:D 17: 5450 :0:0 19: 5453 :0:0 20: 14626 :0:0:D
This works fine the first time through. However, sometimes my flop never evaluates to true, because there is not a blank line at the end of my output. Since the flop will never evaluate to true, the next time I run mySub the operator will be in the true state.sub mySub { foreach ( @arr ) { if ( /^PIDTAB/ ... /^\n/ ) { next if ( /^(PIDTAB|\n)/ ); while ( /\s+(\d+):\s+(\d+)\s*:\S+:\S+:D\s+/g ) { # do something } } } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Flip-flop reset?
by sgifford (Prior) on Aug 30, 2006 at 01:37 UTC | |
by swkronenfeld (Hermit) on Aug 30, 2006 at 14:47 UTC | |
by ysth (Canon) on Aug 30, 2006 at 20:55 UTC | |
Re: Flip-flop reset?
by cdarke (Prior) on Aug 29, 2006 at 20:01 UTC | |
by swkronenfeld (Hermit) on Aug 29, 2006 at 20:14 UTC | |
Re: Flip-flop reset?
by Dietz (Curate) on Aug 30, 2006 at 06:02 UTC | |
Re: Flip-flop reset?
by aartisesha (Novice) on Aug 30, 2006 at 06:54 UTC | |
Re: Flip-flop reset?
by ysth (Canon) on Aug 30, 2006 at 21:56 UTC | |
by runrig (Abbot) on May 31, 2007 at 23:12 UTC | |
by ysth (Canon) on Aug 31, 2006 at 21:07 UTC |