in reply to Matching ranges
I am attempting to match between the first match of "Services", and not after, but I am getting everything using the following code:I cannot reproduce that. I do not get the lines between 'Users' and the next 'Services' (as expected).
Once again, I just want what is in between first occurrence of "Services" and "Users".
Or:use 5.010; while(<>) { state $done; if ( /^Services$/ .. /^Users$/ ) { print "$_"; $done = 1; next; } last if $done; }
while(<>) { if (my $r = /^Services$/ .. /^Users$/ ) { print $_; last if $r =~ /E0$/; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Matching ranges
by ldbpm (Initiate) on Sep 02, 2010 at 12:42 UTC | |
by Marshall (Canon) on Sep 02, 2010 at 14:24 UTC | |
by ldbpm (Initiate) on Sep 02, 2010 at 15:12 UTC | |
by Marshall (Canon) on Sep 02, 2010 at 14:34 UTC | |
by ldbpm (Initiate) on Sep 02, 2010 at 15:21 UTC | |
|
Re^2: Matching ranges
by ldbpm (Initiate) on Sep 02, 2010 at 12:02 UTC |