in reply to Re: Re: Re: 'one-liner' help
in thread 'one-liner' help

My bad. i got my \s and \S mixed up. But the script still does not work as stated above.

Any ideas?

Thanks.
SA
:)

Replies are listed 'Best First'.
Re^5: 'one-liner' help
by dws (Chancellor) on Apr 16, 2003 at 22:25 UTC
    Any ideas?

    As it happens, yes. Note that   m#</div></div># will not match

    </div> </div>
    because there's (vertical) whitespace between the two tags. You need \s* in your regex at points where whitespace is expected to appear between tags. And you need to slurp the entire file into memory first, since doing this line-by-line won't work.

    I've not tried it, but perlrun notes that -00 will force Perl into "paragraph" mode. Given your HTML, that might be sufficient. Otherwise, investigate the other options in perlrun.