in reply to Re: Matching ranges
in thread Matching ranges
This is the weirdest parsing problem I have ever encountered
while(<>) { if (my $r = /^Services/ .. /^Users/ ) { next if $_ =~ /^Services/; print $_; last if $r =~ /E0$/; } }
produces output without the "Services" line, but the following does not (at least for me):
while(<>) { if (my $r = /^Services/ .. /^Users/ ) { next if $r =~ /^Services/; print $_; last if $r =~ /E0$/; } }
even when I try to exit early, $r is not seemingly not respected
while(<>) { if (my $r = /^Services/ .. /^Users/ ) { #next if $_ =~ /^Services/; exit if $r =~ /^Services/; print $_; last if $r =~ /E0$/; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Matching ranges
by Marshall (Canon) on Sep 02, 2010 at 14:24 UTC | |
by ldbpm (Initiate) on Sep 02, 2010 at 15:12 UTC | |
|
Re^3: Matching ranges
by Marshall (Canon) on Sep 02, 2010 at 14:34 UTC | |
by ldbpm (Initiate) on Sep 02, 2010 at 15:21 UTC |