in reply to Stripping tags from a PerlMonks page.

Here is a quick-and-dirty solution. According to your description, it might suffice
while(<>) { next if (/line that i want to skip/); $skip=1 if(/line marking beginning of skip block/); $skip=0 if(/line marking end of skip block/); print unless ($skip || ($.<$startline && $.>endline); }
This lets you define the line you want to skip, a block delimited by two special lines and lines in a certain numeric range.

Replies are listed 'Best First'.
RE: Re: Stripping tags from a PerlMonks page.
by davorg (Chancellor) on Jul 25, 2000 at 17:42 UTC

    Parsing HTML using regular expressions is always a dangerous affair - especially if you have no control over the HTML content - but if you were going to use this approach you could simplify it by using the '..' operator.

    while (<>) { next if /line to skip/; print unless ($startline .. $endline) or (/skip start line/ .. /skip end line); }
    --
    <http://www.dave.org.uk>

    European Perl Conference - Sept 22/24 2000, ICA, London
    <http://www.yapc.org/Europe/>