Thank you for replying. It has moved me forward a little. Upon using:

my $remove = q{<div><div class="blue"></div></div>};

the variable then works in the if statement.

my $str = qr{$line};

or

my $str = q{$line}; <p>gives</p> <code>(?^:</div></div><div><div class="blue"></div></div> )

to the console, and

( $line = $str ) =~ s/$remove//;

gives

(?^:</div></div> )

You are right; I did get a warning before but misunderstood it. Now, adding r to the substition gives another warning:

 Useless use of non-destructive substitution (s///r) in void context at lr.pl line 76.

So I'm still in void context, which is bad, right? And I now have this

(?^: )

to learn about. I also tried using

while (<$HTML>)

with

$_

and writing to a separate file, which is getting warmer, actually removing some of the correct things, but leaving behind

(?^:</div></div> )

I'm also still using print because say doesn't work for me; it asks for a package. If that little lot prompts no further clues to anyone I shall read on; thanks for your time on this.


In reply to Re^2: Strip specific html sequence by koober
in thread Strip specific html sequence by koober

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.