in reply to Between START .. END

# if START and END occur only once, we could lock it with m??
while (<DATA>) { next unless my $count = ?start?../end/; next if $count == 1; print; }

Replies are listed 'Best First'.
Re^2: Between START .. END
by softworkz (Monk) on Sep 14, 2005 at 17:00 UTC
    Here's a regex that would do the trick.

    #!/usr/bin/perl -w use strict; while (<DATA>) { $_ =~ tr/!@#$%^&*//d; # will you encounter funky chars? next unless ($_ =~/(^\d+)/); print $_; } __DATA__ START 1 2 3! 4 5 END START 1* 2 3 4 5 6 END